“insufficient memory for the Java Runtime Environment ” message in eclipse

The message above means that you’re running so many programs on your PC that there is no memory left to run one more. This isn’t a Java problem and no Java option is going to change this.

Use the Task Manager of Windows to see how much of your 4GB RAM is actually free. My guess is that somewhere, you have a program that eats all the memory. Find it and kill it.

EDIT You need to understand that there are two types of “out of memory” errors.

The first one is the OutOfMemoryException which you get when Java code is running and the Java heap is not large enough. This means Java code asks the Java runtime for memory. You can fix those with -Xmx...

The other error is when the Java runtime runs out of memory. This isn’t related to the Java heap at all. This is an error when Java asks the OS for more memory and the OS says: “Sorry, I don’t have any.”

To fix the latter, close applications or reboot (to clean up memory fragmentation).

Leave a Comment