Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Resident memory of java application

868448Jun 13 2011 — edited Jun 14 2011
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 12 2011
Added on Jun 13 2011
6 comments
3,993 views