The NetBeans gives a "low memory" or "not enough memory to compile" warning when it needs more memory to compile your project.
A. Delete NetBeans cache to release memory.
Close NetBeans and delete the cache folder.
Location of NetBeans caches:
Windows: C:\Users\
<user>\AppData\Local\NetBeans\Cache\
<cache folder should be deleted>
MAC OS X: /Users//Library/Caches/NetBeans/
<cache folder>
UNIX: /home//.cache/netbeans/
<cache folder>
B. Allocate more memory for NetBeans.
1. Go to your NetBeans home directory.
2. Open the netbeans.conf file in the etc directory.
3. Find the netbeans_default_options parameter in the file.
4. Set the -J-Xms and -J-XX to larger values.
C. Allocate more memory for your project, follow the steps below.
1. Perform a clean and build of your project. You can get it done by performing one of the followings.
a. Right click your project and select "Clean and Build".
b. Select your project in the Project Pane, then type Shift+F11.
c. Select your project in the Project Pane, then click the Run button in the top menu of the frame and select "Clean and Build Project".
2. Watch the Output pane carefully to make sure that your project compiles successfully.
3. Right click your project and select "Properties". In the pop up window select "Run" in the left Categories. Then, set the VM Options on the right side of the window. For example, setting the VM Option to -Xms64m -Xmx1024m tells your JVM to allocate minimum 64 megabytes of memory to your project up to maximum of 1024 megabytes of memory. However, the memory set here cannot exceed the RAM your machine has.
-----------------------------------------------------------------------------------------------------------
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.