5 Replies Latest reply: Jan 19, 2009 1:07 AM by 843798 RSS

    not able to view heap dump using jhat, 0 objects

    843798
      When I run jhat against a heap dump (hprof) file created by the JVM option "-XX:+HeapDumpOnOutOfMemoryError" it returns the following.....


      C:\Program Files\Java\jdk1.6.0_07\bin>jhat java_pid6941.hprof
      Reading from java_pid6941.hprof...
      Dump file created Sat Aug 16 08:16:55 BST 2008 Snapshot read, resolving...
      Resolving 0 objects...
      WARNING: hprof file does not include java.lang.Class!
      WARNING: hprof file does not include java.lang.String!
      WARNING: hprof file does not include java.lang.ClassLoader!
      Chasing references, expect 0 dots
      Eliminating duplicate references
      Snapshot resolved.
      Started HTTP server on port 7000
      Server is ready.

      Is my hprof file currupted.
        • 1. Re: not able to view heap dump using jhat, 0 objects
          843798
          Try visual vm tool.

          https://visualvm.dev.java.net/

          And let us know if this tool works.
          • 2. Re: not able to view heap dump using jhat, 0 objects
            843798
            When I try to load hprof file in visualVM I get this null pointer exception

            java.lang.NullPointerException
                 at org.netbeans.lib.profiler.heap.HprofHeap.fillHeapTagBounds(HprofHeap.java:858)
                 at org.netbeans.lib.profiler.heap.HprofHeap.<init>(HprofHeap.java:130)
                 at org.netbeans.lib.profiler.heap.HeapFactory.createHeap(HeapFactory.java:84)
                 at org.netbeans.lib.profiler.heap.HeapFactory.createHeap(HeapFactory.java:66)
                 at org.netbeans.modules.profiler.heapwalk.HeapWalker.createHeap(HeapWalker.java:191)
                 at org.netbeans.modules.profiler.heapwalk.HeapWalker.<init>(HeapWalker.java:95)
                 at com.sun.tools.visualvm.heapdump.impl.HeapDumpView$MasterViewSupport$1.run(HeapDumpView.java:111)
                 at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
            [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
            • 3. Re: not able to view heap dump using jhat, 0 objects
              800369
              Are you sure this heap dump came from the use of the HeapDumpOnOutOfMemoryError option? Was there an insufficient disk space or other error? Just wondering if the heap dump is truncated. Does jmap -dump:file=<file> <pid> work?
              • 4. Re: not able to view heap dump using jhat, 0 objects
                843798
                Thanks for your reply. Yes there wasn't enough disk space.
                • 5. Re: not able to view heap dump using jhat, 0 objects
                  843798
                  I took heap dump using HPROF by cntrl\break , when trying to read using jhat, getting the error

                  Reading from C:\apache-tomcat-5.5.12\bin\java.hprof...
                  Dump file created Mon Jan 19 10:27:18 IST 2009
                  java.io.EOFException
                  at java.io.DataInputStream.readFully(DataInputStream.java:180)
                  at java.io.DataInputStream.readFully(DataInputStream.java:152)
                  at com.sun.tools.hat.internal.parser.HprofReader.read(HprofReader.java:2
                  01)
                  at com.sun.tools.hat.internal.parser.Reader.readFile(Reader.java:79)
                  at com.sun.tools.hat.Main.main(Main.java:143)

                  Please suggest what could be the issue