Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.