Glassfish 3.0.1 memory leak when ran with Windows Server 2008 R2 Enterprise

I have a memory leak with Glassfish 3.0.1 and Windows Server 2008 R2 Enterprise (64bit machine), with or without any running applications

Is there a way to resolve this?

The same Glassfish 3.0.1 work fine on linux and Windows XP SP2 without any leaks.

I can see the leak through the Windows Task Manager. I am using Java SE 6 update 22

Thanks!

Answer

The best way to identify memory leaks in Java is to start up the server and let it get warmed up to a normal operating level and then take heap dumps over time. If you are using the Sun JDK you can trigger a heap dump like this:

jmap -dump:file=normal.hprof <pid of java process>

Let the server run for a while and when you see the memory start to climb take another heap dump.

Repeat this process as the heap grows until you are satisfied that you have a good set of data.

You can use jhat to analyze the heap dumps to see what types of objects are filling the heap. The culprit(s) will be increasing over time.

Attribution
Source : Link , Question Author : user66794 , Answer Author : bgould

Leave a Comment