Ever Increasing Process Size (Even with Small Heap Size)

Hello,

I have a process that is started with a max heap size of 256 megabytes....

However after running for a few hours the process size on Linux is seen to start growing and keeps growing to well over a gig of RES memory usage (another gig of VIRT can also be seen)

I have been looking at this for a while now and would like some points as to why the heap and internal memory usage would look fine yet the external (to my code) JVM memory usage for its process just continues to keep growing...

JDK1.6.0u1 / Linux 2.6.x

Any help/pointers appreciated...

-A

[599 byte] By [AlanOLa] at [2007-11-27 7:12:34]
# 1

As an update I have seen that the process size increases when remote debugging is enabled.. (which was my default while developing )

Removed remote debugging options and no memory leak...

This is now reproducible with the code i have here... however getting a small program to show the problem is tricky as my program is quite large and involves a lot of different code from postgres driver, spring, (no hibernate), java5 language features, java.util.concurrent classes etc....

Again any hints ?

AlanOLa at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
Are you getting a out of memory exception?
jschella at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

Hi, This could also be due to heap gragmentation, which has the following:

1) You will always find the GC behaviour proper.

2) You will also not get any OOM exception.

3) JVM will autoimatically slow down and crash.

Another issue is due to native memory leak .

I am also having this same problem and we are using WAS 5.1 and JDK 1.4.2.

As per IBM to avoid the heap fragmentation, they have suggested to get the core dump of the application and using a class loader find the suitable value for the Xk parameter and set that during the JVM startup.

I am planning to try this out on Monday and will post the outcome.

je22chapa at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

Hi Alan,

I tried increasing the Xk option, but still the JVM memory keps increasing. I have no cluie why this is happening and i am sute it is not a bug at OS level or at the Java level. It must be something within the code which is creating this troubole. You have also mentioned remote debuggubg - What is that exactly ? may be i can also ask my team to check if we have similoar stuff in our programm.

je22chapa at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5
> I tried increasing the Xk option, but still the JVM> memory keps increasing. And again, are you getting an out of memory exception?
jschella at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 6
HI Jschell,I am not getting any OOM error. My issue is when i start my web app, the %MEM occupied by java process starts increasing and it keeps going to 30 %, 35 % etc etc and app server goes down.
je22chapa at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 7

What makes you think that memory has anything to do with this?

A java out of memory exception should show up somewhere in an app server log.

An application memory problem, which has nothing to do with the java heap, can cause the app to run out of memory. That sort of problem is not fixable in java.

Another type of system exception can cause an application to exit. That sort of problem is not fixable in java either.

jschella at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 8
I agree. We are also checking for some native leaks. We are using DB2 as database and suspecting the db2java.zip is creating this issue or not. I will let you guys know,once we try this test.
je22chapa at 2007-7-12 19:03:41 > top of Java-index,Java HotSpot Virtual Machine,Specifications...