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.
So how to tell Netbeans, there are plenty of RAM, use as much as you need ?
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.
A medium-sized project currently open in NetBeans is consuming about 184 MB of memory on this machine, with peaks noticeably higher while compiling. As with any advanced design tool, NetBeans will always cheerfully accept more hardware resources and perform better for having them.
Increase the memory heap of the IDEFrom the main menu, select Help | Change Memory Settings. Set the necessary amount of memory that you want to allocate and click Save and Restart.
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.
Here are the instructions in 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.
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"
EDIT: -J-Xms
sets the minimum Java heap size, -J-Xmx
sets the maximum Java heap size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With