Reputation: 2269
A colleague has the following setting in Eclipse / Tomcat run parameters, and complains of out of heap memory all the time:
-XX:PermSize=512M
-XX:MaxPermSize=1024M
-Xmx1024m
If I understand this correctly, both the max PermGen
and max Heap
are each 1 GB. Since PermGen
is a special part of the Heap, this amounts to allocating all of the heap to PermGen
. Is this correct?
Per Perm Space vs Heap Space, I might be correct. Would this be causing the issue?
Per Is Java PermGen Space Part of Total VM Memory, my understanding is not correct.
Upvotes: 2
Views: 696
Reputation: 9028
Enable GC logging, once the Eclipse crashes again, you will see the cause of the problem, the logs will show you the size of PermGen.
GC logging :-XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=jvm.log -XX:+HeapDumpOnOutOfMemoryError -Xloggc:gc.log -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -showversion
Considering the PermGen being part of the Heap or not, this actually depends on the version of the Hotspot you are running. The GC algorithm controls the size of the PermGen, so even though you set MAX=1GB, it may never grow that big and you can still get OOM because of some other issue.
Upvotes: 2
Reputation: 1159
you are right. >512MB are spent for PermGen and <512MB are available for Heap
use JVisualVM shipped with any Sun/Oracle JVM to connect to the running eclipse process and check the actual situation
Upvotes: 3