PHPStorm/Webstorm increase memory to more than 512MB

后端 未结 6 538
忘掉有多难
忘掉有多难 2021-02-02 05:17

I\'m using PHPStorm under Win7 64bit with 64bit Java (latest version I guess) and working currently on an insanely big and chaotic project

相关标签:
6条回答
  • 2021-02-02 05:53

    Simply File > Invalidates Caches / Restart... works for me.

    0 讨论(0)
  • 2021-02-02 05:55

    I found a log file in the application which grew from a few KB to over 2 GB during a few seconds due to a bug. Webstorm was trying to index this 2 GB log file and running out of memory. Deleting the log file solved the problem (and then fixing the bug prevented the log file from growing).

    Prior to this I also tried running the x64 JDK and increasing XMX to 2048. But in the end a 64 bit environment with 2048 MB wasn't enough (even though 512 MB was always enough before).

    0 讨论(0)
  • 2021-02-02 05:59

    PhpStorm 2016.1 and newer

    As of PhpStorm 2016.1 instead of WEBIDE_JDK_64 one should use JAVA_HOME environment variable that should point to your JVM path.

    Versions prior PhpStorm 2016.1

    Like it was mentioned in the @LazyOne's answer, as of PhpStorm v8 (already released), you can use PhpStorm64.exe. But I wasn't able to find any description on how to specify the JVM path for it. The document that explains how to select the JDK version, seems to be a bit outdated.

    After some research, I discovered that you should create WEBIDE_JDK_64 environment variable that should point to the JRE 64-bit installation path. After doing this, you will be able to start PhpStorm64.exe.

    By default it sets max memory to 750mb. If you need more, you can modify the C:\Program Files (x86)\JetBrains\PhpStorm 8\bin\PhpStorm64.exe.vmoptions. The better idea, however, would be to edit your user's vmoptions file. Just copy C:\Program Files (x86)\JetBrains\PhpStorm 8\bin\PhpStorm64.exe.vmoptions to %USERPROFILE%\.IntelliJIdea12\idea.vmoptions and set -Xmx750m to a higher value.

    0 讨论(0)
  • 2021-02-02 06:02

    Changing memory settings for PHPStorm now has a menu option:

    0 讨论(0)
  • 2021-02-02 06:02

    After reading this post, I switched to 64bit version (after installing correct JDK) and increased designated memory to 2GB just to shut it up. But I still hit the ceiling, freezes et.c.

    Eventually realized, that I had my bower_componentsfolder tracked. Folders like this with tons of javascript-files et.c. will basically eat all ram in the world (I also exclude node_modules folder now, same story). So I right-clicked the folder > Mark directory as > Exluded. After some garbage-collection, bumped PhpStorm's memory footprint down to 5-600mb, which seems reasonable.

    0 讨论(0)
  • 2021-02-02 06:08

    Make sure that PhpStorm use 64-bit Java and not bundled one (which is 32-bit). You an check that in Help | About.

    Generally speaking: with 64-bit Java you do not have to change that value as it works a bit differently compared to 32-bit one.

    1) PhpStorm comes with bundled x86 Java and it is the first one that it tries; only then it looks for other Java installations -- check PhpStorm.bat for details (what environment variables and in which order). By defining one of those environment variables (which will point to your 64-bit Java installation) you can tell PhpStorm to use instead of bundled one.

    2) PhpStorm v8 (currently in EAP stage) comes with 64-bit specific files: you should use PhpStorm64.exe and not PhpStorm.exe (same for .vmoptions file -- it should be PhpStorm64.exe.vmoptions).

    I'm not sure how PhpStorm v7 works with 64-bit Java -- have never tried it this way myself.


    Selecting the JDK version the IDE will run under

    https://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under

    0 讨论(0)
提交回复
热议问题