I've noticed that with the last couple of updates in PhpStorm, my Macbook is churning. The fans are all hands on deck. I performed a search and found a post on Stack Overflow that helped tremendously. This might be the kind of thing that has to be re-done with each major update.
Background:
As PhpStorm is a Java based application, there are separate settings for a JVM configuration when running the application. In the older versions of the application, the user had to copy the existing JVM settings to a backup location, and overwrite the existing one. With the newer version, the app can automatically create a "user" profile that allows you to edit it directly without fear of jacking up the system.
The default JVM settings only allot for 128mb of use with the application - which isn't nearly enough. I'm guessing I hit that wall and it causes everything else to slooooooow down.
Steps:
Step 1: On a Mac, go to Help->Edit Custom VM Options
This automagically creates a "user" JVM profile. You might have to be in a project in order to see this on the Help menu.
Step 2: SAFETY PRECAUTION - Copy the existing data within the file to a file OUTSIDE of the application. For example, copy it to a text file within Sublime Text. I do this in case something doesn't work exactly right, I can replace the text with the original. SAVE THIS FILE SOMEWHERE YOU WILL REMEMBER.
Step 3: Replace the existing settings in the open file in PhpStorm with the following:
-server -Xss256k -Xms1536m -Xmx1536m -Xmn512m -XX:PermSize=350m -XX:MaxPermSize=350m -XX:MetaspaceSize=350m -XX:MaxMetaspaceSize=350m -XX:+UseParNewGC -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+CMSPermGenSweepingEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:CMSInitiatingOccupancyFraction=70 -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError
Step 4: Save the settings, and restart PhpStorm.
Further Reading:
- https://stackoverflow.com/questions/45063979/phpstorm-2016-and-2017-very-slow-for-php-projects-on-macos
- https://intellij-support.jetbrains.com/hc/en-us/articles/206544869
EDIT - 2017-10-26:
I have noticed that phpStorm was VERRRRRY slow when working within a rather large .vue file. I found a new/old post that had additional items to configure within phpStorm...and I noticed an immediate difference.
I am copying the responses that helped me, in case they ever "go away". But you can read the post below:
https://stackoverflow.com/questions/23842924/phpstorm-very-slow-and-sluggish-on-netbook-optimize-ide-for-responsiveness
- Disable language injections: File -> Settings -> Language injections. Untick as many boxes as you're comfortable with. HTML was the real killer for me.
- Disable inspections: File -> Settings -> Inspections. Untick as many as you don't need.
- Disable unused plugins: File -> Settings -> Plugins. Untick unused.
These changes brought down both the startup time and significantly increased responsiveness of the IDE in general.
Edit 2017: You may also want to try experiment with allocating PhpStorm some more RAM. Do this by
- Going to Help -> Edit Custom VM Options
- Change -Xms and -Xmx to be something reasonable for your hardware. I have -Xms512m and -Xmx2048 on an 8GB RAM laptop.
- Restart PhpStorm.
- If you want to see how much RAM PhpStorm is currently using, you can go to File -> Settings and search for and enable show memory indicator.
Add these to your phpstorm.exe.vmoptions or phpstorm64.exe.vmoptions file, at the bottom:
-Dawt.useSystemAAFontSettings=lcd -Dawt.java2d.opengl=true
2017-11-15 - Here is an updated web page with additional settings:
https://www.stitcher.io/blog/phpstorm-performance