PHPStorm consume high memory on Mac

Answered

I have been using PHPStorm for couple years on Mac, but it is the first time I realize this.

I am not sure about previous version, but the current version 2016.3.1 - 2016.3.2, it consumes a lot of memory on Mac El Capitan (Mid 2015). It will go from 1.3G when I open it to over 2G while I am coding. 

My mac has 16G men, but PHPStorm and the two software (MySQL Workbench and Chrome) will eat 8G about it. Usually after couple hours work, PHPStorm will go to 1.8G, Chrome will go to 2.2, and Workbench will go to 2.5G. My Mac freeze completely many times since I upgrade to 2016.3. 

I know Workbench and Chrome consume a lot memory as well. But I am just wondering, is it normal that PHPStorm consume memory between 1.3 - 2G on Mac El Capitan? If it is OS issue, I will try to upgrade to the new one. Not sure if the other Mac users or Windows users have same issue.

48 comments
Comment actions Permalink

Ddruganov looks like you're running Intel-based PhpStorm installation on an M1 Mac.

Please download an Apple Silicone -based distrib file & install it instead.

 

Without it macOS runs the app in Intel-emulation mode and allocates for it at least twice the RAM.

0
Comment actions Permalink

Dmitry Tronin umm no? i even double checked and reinstalled the m1 version twice; my coworkers on windows get about 700 mb usage for the same project, thats insance

0
Comment actions Permalink

We can look closely into this.

I would need to check IDE logs & vmmap output. Could you please run Help > Collect Logs and Diagnostic Data and share the resulting archive? You can upload it at https://uploads.jetbrains.com/ - only JB staff can browse it.

Next, I'll need to check vmmap output:

1. wait until PhpStorm starts consuming a lot of memory again;
2. find phpstorm PID via ps -A | grep phpstorm
3. execute in terminal vmmap ID_from_previous_step > vmmap.txt

Share the resulting vmmap.txt file + a screenshot of how much memory PhpStorm was consuming (for example using top). vmmap is a tool that shows memory usage of java processes. 

0
Comment actions Permalink

Dmitry Tronin shall do tomorrow first thing

0
Comment actions Permalink

Dmitry Tronin logs upload id: 2022_07_12_bganRdAqHdgAjiq2xbn7Gd (file: phpstorm-logs-20220712-0828113257833015946024604.zip)

right now phpstorm is using 11 gigs of ram while doing nothing so im gonna make a vmmap dump too

0
Comment actions Permalink

Dmitry Tronin heres the vmmap dump and a screenshot of Activity Monitor; at the time of making the vmmap dump RAM usage was 11 gigs but then it suddenly jumped to 11.99
Upload id: 2022_07_12_c7x7PyPVTFUdJSwBXqUYBP (files: Снимок экрана 2022-07-12 в 08.31.26.png, vmmap.txt)

0
Comment actions Permalink

Thanks a lot. In short: that's https://youtrack.jetbrains.com/issue/JBR-3631 and unfortunately it's not addressed yet.

A bit more info: here's how memory is utilized by the PhpStorm process:

Writable regions: Total=14.1G written=5.2G(37%) resident=3.6G(26%) swapped_out=8.2G(58%) unallocated=2.3G(16%)

 

Here "written" is the actual amount of memory allocated by IDE: 5.2G, of which 3.6G is actually used ("resident").

"swapped_out" is the cause of the issue here: it's 8.2G in size. The main "swapped_out" contributors besides VM allocations are: IOAccelerator (3.6G) & IOSurface (1.2G) - these are native OS X classes used for interaction with graphics and video hardware. Sadly our developers hadn't yet figured out why these classes go crazy when IDE is launched. 

One of our users shared a possible workaround: change Java runtime to jbr_nomod-11_0_12-osx-aarch64-b1649.1 using this article.

 

0
Comment actions Permalink

Dmitry Tronin no runtime exists with that name

0
Comment actions Permalink

Dmitry Tronin made storm install that version but it still launches at 3 gigs of RAM like wtf

ill be monitoring the issue next couple of days and report whether "jbr_nomod-11_0_12-osx-aarch64-b1649.1" made any difference in memory consumption

0
Comment actions Permalink

Where did you get it from? 

IDE will start with at least 4GB RAM allocated because of the configured VM configuration. It's done at Help | Change Memory Settings. You have it set to 4096, but you can try lowering it based on your project memory usage. You can view the current memory utilization in IDE task bar:

 

0
Comment actions Permalink

Dmitry Tronin yeah my bad, i do have 4 gigs allocated at startup; storm itself shows 1822/4096

0
Comment actions Permalink

Dmitry Tronin so its been a couple of weeks now and php storm is again at 20 gigs of memory consumption, insanity all over again

got any more fixes?

0
Comment actions Permalink

Dmitry Tronin Yeah, it's called Visual Studio Code.

0
Comment actions Permalink

Price84 but it's just notepad :)

 

0
Comment actions Permalink

Price84 thing is, I absolutely love VSCode and I worked with it for 1.5 years before switching to phpstorm but now I just cant go back - the refactoring and intellisense capabilities of phpstorm are just wild compared to Intelephense or any other open source php language servers

0
Comment actions Permalink

Unfortunately the original issue is still not resolved. It would be great if you could help us to investigate the problem by following these instructions: https://youtrack.jetbrains.com/issue/JBR-3631/Intellij-high-memory-usage-on-apple-silicon-M1-7-8GB-of-RAM#focus=Comments-27-6320135.0-0

0
Comment actions Permalink

Dmitry Tronin phpstorm v2022.2 (Build #PS-222.3345.135) seems to have fixed the issue; ill be monitoring it further still just to be sure

0
Comment actions Permalink

Thanks for the update. The issue is sadly still not fully fixed on our end so it can possibly return.

0

Please sign in to leave a comment.