30

I'm using PHPStorm (5.0) as PHP IDE, but I'm busy building some frontend stuff with Javascript at the moment. The problem is: PHPStorm gets very slow. It uses all 494M of memory while editing the Javascript file. I don't have any active files other than my Javascript file. The file itself is only 191 lines long.

  • I invalidated the caches;
  • I restarted PHPStorm / my computer;
  • I turned off all Javascript inspections.

Is there anything I can do to speed things up?

4
  • Have you tried Power Save mode? PyCharm has it, may do what you want. Although it looks like a bug in PHPStorm: even if your JS file is strange or malformed, the IDE should be able to just stop processing it and not cause system slowdown.
    – Tadeck
    Commented Sep 17, 2012 at 8:15
  • that is weird, you shouldn't need to do any off the things you mention. Or power save mode. There is another problem. I have a fully fledged java enterprise web app (with intellij), its using 150mb and I have the php plugin. Send it to jetbrains support, they are nomrally pretty quick replying. Commented Sep 17, 2012 at 8:18
  • it's almost definitively something to do with large amounts of files in the watched directories
    – oligofren
    Commented Mar 19, 2015 at 19:22
  • 1
    I have problem on Ubuntu 15.04 with project on a remote server through SSHFS. My Java process is making whole system unresponsive, I must wait about half a minute after pressing shortcut for xkill window. After killing PHPStorm, everything back to normal. Then, after maximum few hours, problem returns. SOMETIMES, after boot, these issue not appears, or appears very rare. That's quite strange. I've tried vmoptions tuning, without success. I'm using Oracle SDK/JRE (x64).
    – mrarm
    Commented Dec 21, 2015 at 15:15

8 Answers 8

39

If you're running a project with an exceptionally large code base, the performance of the IDE can really chug because by default it watches all the files in all subdirectories of your loaded project.

Generally, a large code base will not require watchers on a good portion of the files. You can improve performance by going to File/Settings/Project/Directories and excluding any folders you do not need to watch/search within.

If you do need to search within those files, you get the option to include excluded directories and search again anyway.

Also, disabling any plugins you aren't using can help improve performance as well, but not as much as the directories thing.

6
  • 1
    What do you mean by 'exceptionally large code base'? What number of files is exceptable at least? Commented Aug 7, 2015 at 10:17
  • 1
    @GerarddeVisser I don't think this is a finite/specific value. I just mean something large scale with many nested directories - a subset of which is likely application code that you want to index, and a subset of which is likely plugins/ frameworks/ toolset/ etc. that you don't need to be indexed.
    – 1nfiniti
    Commented Aug 7, 2015 at 20:57
  • @GerarddeVisser - you will notice when the code base becomes to big as webstorm has intense moments of unusability. I have only ever experienced it in one project code base - and its BIG. Commented Feb 23, 2016 at 9:48
  • Excluding all all node_modules, vendor and bower_components folders fixed the issue for me.
    – leymannx
    Commented Nov 1, 2016 at 10:24
  • 2
    For Drupal: excluding the files directory results a huge performance improvement. Commented Jan 26, 2017 at 14:59
7

Fix 1. disable spelling. File->Settings->Editor->Inspections->Spelling

Fix 2. If on linux try this: In /phpstorm/bin/ you find - phpstorm.vmoptions - phpstorm64.vmoptions

In phpstorm goto help->about and check if JRE is 64 or not. If 64 edit phpstorm64.vmoptions.

Insert these 2 lines at the end. -Dawt.java2d.opengl=true -Dsun.java2d.xrender=false

2

In case of the performance isues file the problem at YouTrack and upload a CPU snapshot, each problem is unique and requires investigation.

2
  • 5
    I confirm, even with the best hardware(2014, 64bit, 4GB for PHPStorm ) its unbearable slow. I also noticed that you always asked for snapshots, since years! But the performance never changed on this. I also turned off automcompletion but it doesn't make any difference.
    – xamiro
    Commented Feb 2, 2014 at 13:57
  • I went through this process and it was worth it. It took quite some time, but their support was very thorough in the end.
    – Henry
    Commented Jun 22, 2016 at 0:02
1

I just went through a fairly detailed process with JetBrains. It turned out it was my secondary monitor. I have a 28" retina display. If I run it on the default resolution 1920x1080 in true retina it runs fine. When I up the resolution the performance really starts to drag. As of right now (June 2016), this is an open issue in their system with no solution.

I also discovered that if you use .gitignore, you should also mark these files and directories as 'Excluded' in the IDE. That helps somewhat with larger projects.

2
  • Thanks for this info. It led to me FINALLY figuring out my issue after months of searching. I also have two monitors. One is a new 27" iMac with Retina, and the other is a Thunderbolt Display, which is not Retina. It turned out, this problem was only happening when I had a WS window on BOTH monitors. If I keep all WS windows on either monitor, it runs very smoothly. If I drag one window to the other monitor, it eventually slows to a crawl. So I just assigned WS to a single monitor, and I can live with that. Thanks though. This was a LONG time coming Commented Mar 2, 2019 at 0:59
  • While other answers resulted in some improvements. This answer led me to find the problem on my system. I use macOS with external monitors. I had Mission Control's "displays have separate Spaces" enabled and disabling it fixed it for me.
    – yancoupro
    Commented Jan 5, 2020 at 16:48
1

I had the same issue a while ago, here is what helped me to resolve it.

First make sure you exclude the node_modules folder in Settings -> Directories.

This change made it better for me, but did not resolve all the performance issues I had with JavaScript files.

  1. Uninstall PHPStorm
  2. Download and Install the JetBrains Toolbox (https://www.jetbrains.com/toolbox/app/?fromMenu)
  3. Install PHPStorm via the JetBrains ToolBox
  4. Open the PHPStorm settings menu within the Toolbox (Screenshot)
  5. Increase the maximum heap size to 1024 MB
  6. Restart PHPStorm
2
  • I can confirm this solution worked for me. Would never guess myself to reinstall PHPStorm from Toolbox and increase memory limit to solve javascript memory issues. Maybe it's possible to increase memory limit on the already installed PHPStorm, but didn't try it, as initial solution was okay. Commented Feb 5, 2018 at 15:26
  • 1
    FYI all this does is change the -Xmx option to -Xmx1024m. You can do this on the non-toolbox version by editing help->edit custom VM options on mac
    – btraas
    Commented Dec 1, 2018 at 21:24
0

PHPStorm and all Jetbrains products are slow wjen opening large files (2000+ lines of code). You may have a good PC but the problem is not in PC or processor. On the same hardware Eclipse, Netbeans are much better if we are talking about speed. Just read this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206999515-PhpStorm-extremely-slow-on-large-source-files

0

As of 2018 it's completely different. PHPStorm provides a simple way of changing JVM options.

  1. From the main menu, choose Help | Edit Custom VM Options
  2. Change Xmx value to a higher value. Default value is 750m. Increasing it to 1024m was enough for me.
  3. Now your PHPStorm should start working as usual.
-2

PHPStorm will always feel slower than native apps on whatever OS you have (I use it on Windows, Linux and Mac), just because Java is slower. I had to do a lot of tweaking to make it feel faster, and the only thing that really improved speed was a SSD hard disk.

Try tweaking vmoptions file a bit and you will get better performance, but dont expect it to behave like native apps. For simple file edits (not projects) just use an editor like Sublime Text, Vim or whatever.

3
  • What exactly have to tweak in vmoptions? Commented Apr 24, 2015 at 12:49
  • This is my vmoptions: -Xms128m -Xmx750m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=225m -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djsse.enableSNIExtension=false -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -Dawt.useSystemAAFontSettings=lcd Depending on your PC, you have to adjust the first 3 lines which manage the memory your java app (phpstorm uses). When i'm home i'll check my other config and post it here. Commented Jun 3, 2015 at 2:48
  • 20
    are you home yet?
    – qwertzman
    Commented May 24, 2016 at 12:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.