简体   繁体   English

Netbeans上的PermGen空间错误

[英]PermGen space error on Netbeans

im getting java.lang.OutOfMemoryError: PermGen space error. 我正在获取java.lang.OutOfMemoryError:PermGen空间错误。 I tried to change in netbeans.conf but no success.. 我试图更改netbeans.conf,但没有成功。

i changed 我变了

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.g raphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"

to

netbeans_default_options="-J-client -J-Xmx3g -J-Xss2m -J-Xms32m -J-XX:PermSize=512m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"

it doesnt work.Any tipps ? 它不起作用。有小费吗?

For PermGen problems increasing Xmx won't help due to how the memory is partitioned. 对于PermGen,由于内存的分区方式,增加Xmx将无济于事。

But, if you use VisualVM it can help you to visualize how your memory is being used, and you can start to make adjustments. 但是,如果您使用VisualVM,它可以帮助您可视化内存的使用方式,并且可以开始进行调整。

For one application my PermGen ended up being about 750M in size, but that was for a very large web application. 对于一个应用程序,我的PermGen最终的大小约为750M,但这适用于非常大的Web应用程序。

Hopefully you are using the 64-bit version of Java otherwise you have fewer options. 希望您正在使用Java的64位版本,否则您的选择较少。

You can set your max memory size to be 4G, if you have a great deal of memory, and PermGen to perhaps 1G, and then use VisualVM to see how large your memory gets. 如果您有大量内存,可以将最大内存大小设置为4G,将PermGen设置为1G,然后使用VisualVM来查看内存的大小。

If you feel it is too large then you will need to start looking at what is loaded and make decisions, but it helps to see what is happening and work your way down to a more reasonable number. 如果您觉得它太大,则需要开始查看加载的内容并做出决定,但这有助于查看正在发生的事情并逐步找到更合理的数字。

You are trying to start Netbeans with 32MB (Xms32m). 您正在尝试以32MB(Xms32m)启动Netbeans。 It should be at least 256m (512m for Windows). 至少应为256m(对于Windows为512m)。

If you're still getting that error, you could consider increase Xmx if you have more that 4GB of RAM. 如果仍然出现该错误,则如果您拥有超过4GB的RAM,则可以考虑增加Xmx。 On Windows you should leave at least 1.5GB of RAM for the OS 在Windows上,您应至少为操作系统留出1.5GB的RAM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM