PHPStorm Memory issues: sometimes almost 3Gb RAM usage
Memory related issues are a known problem; I would kindly suggest to the Jetbrains team to provide a way to US THE USERS to find out a way to deal with that, as I have seen many posts about this problem. For example something that is a REAL issue is that NO MATTER how much RAM / CPU a device can have, PHPStorm (in my case) takes a percentage of it; some users have reported that it is NORMAL that if they have 64 GB memory, the IDE takes 15-16 of RAM... that is a LOT !!!!
I know that the are plugins that use more memory than other, like Laravel IDEA... is acceptable since it work with all references BUT.. it would be a better solution for the user to have the IDE to take a SPECIFIC or TOP memory ACCORDINGLY to the ram usage, THAN a percentage as it seems it happends.
Also (may be is not the place to request this) is better to ADD a PLUGIN RAM USAGE window or place to see this; and this will help also to the Jetbrains teams, as I can't image having a LOT of memory issues and having so many SNAPSHOTS to check, it is to much work.
So... please at least let me know if you can consider this...
I love PHPStorm so my comment is to have the user experiencie in a better level.
Please sign in to leave a comment.
In fact, the memory consumption depends on the Java heap size which you can configure at Help | Change Memory Settings.
If it's set to 2048mb, PhpStorm can occupy up to ~4GB because of the overhead: https://intellij-support.jetbrains.com/hc/en-us/articles/360018776919-Understanding-IDE-memory-allocation-
The way Java works, as the VM needs memory, it fills up the heap. When the application no longer needs as much memory, Java doesn't fully shrink it, it empties the heap, but its size only gets slightly smaller.
That is why when you see reasonable memory consumption in the status bar memory indicator in PhpStorm, the process might still have a hefty RAM consumption value. Sadly, there isn't much we can do about it.
So, if you want to decrease the memory footprint, the only reliable way is to decrease the heap size via Help | Change Memory Settings, but there's a limit you can do that to - at some point, you'll start getting low memory signals because our stuff just won't fit anymore.
Unfortunately, it's technically impossible - plugins spawn objects that are not different to the ones PhpStorm generates itself.
Well, if they set the heap size to 12-16GB - it's not surprising at all... We don't recommend doing that even if you can afford it - the garbage collector will start choking and you'll worsen the performance instead of improving it.
Setting heap size to 2G makes PHPStorm literally unusable, and it constantly throws a “out of memory” error. If you do not recommend setting heap size to 12-16G, what would be the reasonable value then? Lets say for 32G RAM? Setting low value makes IDE unusable, setting high value makes IDE unusable. I've tried, 2, 4, 6, 8, 10, 12, 16 - it's all the same. You are either getting out of memory error or you're ending up with 1200% CPU usage + 24G memory usage which is ridiculous. And I don't even talk about re-indexing process, which is way worth even than that.
Sadly, there is no magic formula as memory usage could be very different from installation to installation and depends on lots of factors – plugins, project size and complexity, external process spawned by IDE, etc.
If IDE freezes or takes way too much memory despite the setting, there could be some other reason that you cannot fix by changing the `xmx` value alone. I would suggest collecting logs (Help > Collect Logs) and submitting a YouTrack report:
https://youtrack.jetbrains.com/newIssue
I have the same issue, and my 16Gb Macbook Pro just can't handle 2 opened PhpStorm projects (backend and frotnend) and Docker (which is limited just to 2Gb ram). MacOs memory pressure going to red and it's sluggish and eats battery very fast.
Also having issues with memory usage, PHPstorm/Webstorm/GoLand instance takes like 1.5Gb each minimum, when opening several projects it can take up to 10GB is summary which is crazy on my 16Gb machine. And i'm not using lot of extensions or so.
RN I'm testing vs code and it looks like a joke when electron-based IDE with lot of extensions takes like 100-200mb per project and does mostly the same.
You guys must do smth with that, for now i don't see any reason to continue my 8+ years jetbrains journey…
Anatoliy Vedmid, Roman Kunashko, since the original thread was created in 2022 and because the root cause may vary, I would like to ask you to submit separate requests via Help | Contact Support or here and attach IDE logs for further investigation
Thank you for all your replies; What I concluded is that if you have files with more than 1000 lines, that is when PHPStorm becomes slow, because of everything it analyzes and processes. I don't see a solution for it, but it is what it is.