Java heap space (java.lang.OutOfMemoryError) Exception when i build ejb module on Netbean6.9.1

706 Views Asked by At

The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError: Java heap space

enter image description here

I have also updated this prems to -Xmx1024m -Xmx2048m -XX:MaxPermSize=2048m

but still face same exception here...

2

There are 2 best solutions below

1
Z.I.J On BEST ANSWER
Currently I have changed the Java plat from jdk 1.5 to Jdk 1.6 in Netbean properties

enter image description here

Now EJB build successfully.

1
DeepInJava On

Try increasing memory of 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.

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.