Resident memory of java application
868448Jun 13 2011 — edited Jun 14 2011Hi,
When I start my application, I have set max heap size as 2 GB (-Xmx2048M). Since I set max heap size as 2 GB, the resident memory of the java application should be less than 2.5 GB ( Max Heap + Jars Memory + VM Memory ). But the resident memory of the java application is keep increasing (4+ GB) without throwing OutOfMemory error. When I see the java heap memory usage using JMX, it shows only 1.6 GB. The gc.txt log also shows only 1.6 GB.
I assume, there is no memory leak in my java code because of below reasons,
There is no OutOfMemroy error, even though java resident memory shows 4+ GB.
The JMX stats shows memory heap size as 1.6 GB.
I don't why the resident memory of the java application keep increasing without OutOfMemory. As per my knowledge, there are 2 cases this will happen,
If the java app triggers any process using Runtime.getRuntime() and the process has memory leak
If the java app triggers any native call (JNI) and the native implementation has memory leak
In my case, my java app neither use any Runtime.getRuntime() method call nor my own native implementation call. But the resident memory of my java app is keep increasing without OutOfMemory error.
My Setup Details :
JDK : java version "1.6.0_16" - Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
OS : Linux x.x.x.x 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
Java GC Options : -Xmx2048M -Xms2048M -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -verbose:gc -Xloggc:../logs/gc.txt -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime
Can you please help me to solve this issue ? Kindly let me know, if you require any other information.
Thanks,
Ramesh