Managing Java Memory – heap size, max perm size, GC collection etc.,

Nov 30 2011 Published by under Java

1. –Xms512m and –Xmx2048m

Define the minimum and maximum heap space.

2. –XX:MaxPermSize=128M

Java object and java classes are stored in separate memory areas. Objects are stored in the heap space and classes are stored in the permanent generation defined by MaxPermSize. More information – http://blogs.oracle.com/jonthecollector/entry/presenting_the_permanent_generation

3. –XX:+UseParallelGC

One thread per CPU to perform the garbage collection

4. –XX:ParallelGCThread=4

Number of threads to perform garbage collection

5. –XX:MinHeapFreeRatio

Minimum percentage of free space

6. –XX:MaxHeapFreeRatio

Maximum percentage of heap space that can be used; if it exceeds this value generation will shrink heap space to meet this value

For more jvm options refer – http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

No responses yet

Leave a Reply