I am using PhpStorm 2018.3.5 (don't wish to update because of this issue) and it has been working fine until all of a sudden today I had two instances running of it and then BOTH projects decided they needed to do a scan and reindex.
Very rarely will I have memory issues when they do this (I allowed it 2GB) but it was quickly eating up the memory and then stalling once it ran low on memory available to it.
It became unresponsive so I had to close it via Windows task manger.
I tried restarting Windows, no difference.
I then thought I would make sure I only one a single instance open and see if that helped, no difference, quickly ate up the memory.
So I gradually gave it more memory to use, which made no difference, however much I gave it it would easily chew that up - I allowed up to 6GB.
I tried invalidating all caches etc and restarting - no difference.
I tried deleting the ".idea" file and recreating the project - no difference.
Watching the background task it seems the memory surges when it's in the "Indexing - Updating indices" stage; it's on this stage for awhile, but once it gets to a certain point the memory usage jumps very rapidly, but it is unclear why.