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!

How to take regular heap dumps using HPROF

843829Dec 13 2006 — edited Jan 2 2007
Hi Folks,

I am using Oracle App server as my application server. I found that the memory is growing gradualy and gets maxed out with in 1 hour. I am using 1 GB of heap.

I defently feel this is a memory leak issue. Once the Heap usage reaches 100%, I will start getting the FULL GCs and my whole server hangs and nothing will work. Some times even the JVM crashes and restarts again.

I didn't find Out of Memory exception also in any of my logs.

I came to know that we can use Hprof to deal with this.
I use the below as my JVM agrs...
-agentlib:hprof=heap=all,format=b,depth=10,file=$ORACLE_HOME\hprof\Data.hprof

I run my load run for 10 mins, now my heap usage has been grown to some extent.
My Questions:
1. Why there are 2 files generated, one is with the name Data.hprof and another with Data.hprof.tmp. Which is what?
2. How to get the dump at 2 different points. So that I can compare the the 2 dumps and I can say which object is growing more.

I downloaded the HAT and If I use to open this Data.hprof file from HAT, I am getting this error. This error will come if I open the file with out stoping the JVM process.

java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:178)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at hat.parser.HprofReader.read(HprofReader.java:202)
at hat.parser.Reader.readFile(Reader.java:90)
at hat.Main.main(Main.java:149)

If I stop the JVM process, and then open through HAT I am getting this error,

Started HTTP server on port 7000
Reading from hprofData.hprof...
Dump file created Wed Dec 13 02:35:03 MST 2006
Warning: Weird stack frame line number: -688113664
java.io.IOException: Bad record length of -1551478782 at byte 0x0008ffab of file.
at hat.parser.HprofReader.read(HprofReader.java:193)
at hat.parser.Reader.readFile(Reader.java:90)
at hat.Main.main(Main.java:149)

JVm version I am using is: Sun JVM 1.5.0_06

I am seriously fed up of this memory leak issue... Please help me out folks... I need this as early as possible..

I hope I get early replys...

Thanks in advance...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 30 2007
Added on Dec 13 2006
3 comments
838 views