PHPStorm/Webstorm将内存增加到512MB以上 [英] PHPStorm/Webstorm increase memory to more than 512MB

查看:544
本文介绍了PHPStorm/Webstorm将内存增加到512MB以上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Win7 64bit64bit Java (latest version I guess)下使用PHPStorm,目前正在处理一个疯狂而又混乱的项目.有许多包含10k LOC的类.因此,我的PHPStorm有时会耗尽内存.

I'm using PHPStorm under Win7 64bit with 64bit Java (latest version I guess) and working currently on an insanely big and chaotic project. There are many classes containing 10k LOC and more. Therefore my PHPStorm runs out of memory once in a while.

我得到一个不错的Out-of-Memory对话框,建议增加内存设置.我目前已在PhpStorm.exe.vmoptions中设置

I get this nice Out-of-Memory dialog suggesting increasing my memory settings. I currently have set in my PhpStorm.exe.vmoptions:

-server
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50

问题是:当我增加要在此文件中使用的内存时,在启动程序时出现以下错误:

The problem is: When I increase my memory to be used in this file I get the following error when starting the program:

创建JVM失败:错误代码-4

Failed to create JVM: Error code -4

我在Google周围搜索,但似乎没有人希望内存比512MB 更多.

I Googled around but nobody seems to want the memory to be more than 512MB.

有人知道我可以怎样使用PHPStorm,而不会再遇到麻烦吗?

当然,我可以重置缓存,但这不是永久性的解决方案,对吧?

Sure, I can reset the cache but this is not a permanent solution, right?

我在某处读到,将此行添加到我的vmoptions是个好主意,但我看不出任何区别:

I read somewhere that adding this line to my vmoptions is a good idea, but I don't see any difference:

-server
....
-XX:MinHeapFreeRatio=15

推荐答案

请确保PhpStorm使用64位Java而不是捆绑其中的一个(32位).您在Help | About中进行了检查.

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

通常来说:使用64位Java时,您不必更改该值,因为它的工作原理与32位Java相比有点.

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附带了捆绑的x86 Java,它是第一个尝试的Java.只有这样,它才会查找其他Java安装-检查PhpStorm.bat以获得详细信息(什么环境变量和顺序).通过定义这些环境变量之一(将指向您的64位Java安装),您可以告诉PhpStorm使用而不是捆绑的变量.

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 (当前处于EAP阶段)随附64位特定文件:您应使用PhpStorm64.exe而不是PhpStorm.exe(与.vmoptions文件-应该为PhpStorm64.exe.vmoptions).

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).

我不确定PhpStorm v7如何与64位Java配合使用-从未亲自尝试过这种方式.

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

选择要在其下运行IDE的JDK版本

https: //intellij-support.jetbrains.com/entries/23455956-选择-JDK版本-IDE-将在以下运行

这篇关于PHPStorm/Webstorm将内存增加到512MB以上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆