Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to assign more memory to Netbeans?

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 ?

like image 390
Frank Avatar asked Sep 24 '13 21:09

Frank


People also ask

How do I allocate more memory to NetBeans?

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.

How much memory does NetBeans?

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.

How can I increase my IDE memory?

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.


1 Answers

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.

like image 156
Costis Aivalis Avatar answered Sep 18 '22 12:09

Costis Aivalis