Need Help On GC.
Hi,
Can any one answer my question.
As part of my application performance testing one of the container in my application using more memory.(Java Based Application).
This application is on solaris platform. When the application started this container normally uses 400 MB. When the load increases on the application this container starts eating memory. This will go up to 2345 MB. We have specified vmparam -Xmx2048m for this container.But still it crossed 2048 MB. My total system memory itself 8 GB.This container alone is eating 2.4 GB.
After this I have kept my application idle for more than 24 hours.This used memory never come down.It was like that.
1.Once GC runs it will free up this memory?
2.After GC freeing up memory unused memory by java will be given to OS?.
3.Memory can be occupied more than what we have specified in Xmx?.
4.Is this memory Leak?
Can any one answer.
Regards
Sai.
Try to use JVM option
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC
to evaluate application memory usage... and to discover when and how Garbage Collector works.
> 1.Once GC runs it will free up this memory?
Young objects which live for a small time are periodically freed by GC with young collections.
If your container lives for a long time, it will be copied in old generation, and will be eliminated only when it will die and old generation will occupy a percentage of the space assigned.
See http://java.sun.com/docs/hotspot/gc1.4.2/#2.%20Generations|outline to obtain informations about tuning GC.
> 2.After GC freeing up memory unused memory by java
> will be given to OS?.
Sorry, I don't know but I think this memory is reserved to JAVA application
> 3.Memory can be occupied more than what we have
> specified in Xmx?.
Xmx is the heap reserver to application which can't exceed this quota. When memory lacks, GC works in order to free space, if possible
> 4.Is this memory Leak?
In paper http://java.sun.com/developer/technicalArticles/Programming/turbo/index.html you can found some other informatins on GC. You can also find the description of a JVM option which can be used to discover memory leaks: -Xrunhprof
Bye
Diego