如何为Netbeans分配更多的内存? [英] How to assign more memory to Netbeans?

查看:504
本文介绍了如何为Netbeans分配更多的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的PC上有24 GB的RAM,但是有时Netbeans编译我的项目时,它说没有足够的内存来编译它,我查看了内存使用情况,它显示为:586/590 M.

I have 24 GB of RAM on my PC, but sometimes when Netbeans compiles my projects, it says not enough memory to compile it, I looked at the memory useage, it shows : 586/590 M.

那么如何告诉Netbeans,有足够的RAM,可以根据需要使用多少内存?

So how to tell Netbeans, there are plenty of RAM, use as much as you need ?

推荐答案

在Netbeans-Home下的 etc 目录中,编辑文件 netbeans.conf . -Xms -Xmx 应该增加到允许您的程序进行编译的值.

In the etc directory under your Netbeans-Home, edit the file netbeans.conf file. -Xms and -Xmx should be increased to the values that allow your program to compile.

这是 netbeans.conf 中的说明:

# Note that default -Xmx and -XX:MaxPermSize are selected for you automatically.
# You can find these values in var/log/messages.log file in your userdir.
# The automatically selected value can be overridden by specifying -J-Xmx or
# -J-XX:MaxPermSize= here or on the command line.

将值放入 netbeans_default_options 字符串中.这是我的(删除换行符,为提高可读性而添加):

Put the values in the netbeans_default_options string. Here is mine (remove linebreaks, added for readability):

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m 
-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  -J-Dsun.awt.disableMixing=true 
-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Nimbus"

编辑:-J-Xms设置最小Java堆大小,-J-Xmx设置最大Java堆大小.

-J-Xms sets the minimum Java heap size, -J-Xmx sets the maximum Java heap size.

这篇关于如何为Netbeans分配更多的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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