Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4618

HeapFactory cannot process multi heap segment files

    XMLWordPrintableJSON

Details

    Description

      I am trying to generate .hprof file according to the Java Profile 1.0.2 specification. I believe I am fully following the specification (which allows multiple heap segments), but NetBeans Profiler library chokes up on my file and yields following exception:

      java.lang.IllegalArgumentException: Invalid dump tag 0 at position 1415
      	at org.netbeans.lib.profiler.heap.HprofHeap.readDumpTag(HprofHeap.java:1138)
      	at org.netbeans.lib.profiler.heap.HprofHeap.fillHeapTagBounds(HprofHeap.java:1215)
      	at org.netbeans.lib.profiler.heap.HprofHeap.<init>(HprofHeap.java:140)
      	at org.netbeans.lib.profiler.heap.HeapFactory.createHeap(HeapFactory.java:80)
      	at org.netbeans.lib.profiler.heap.HeapFactory.createHeap(HeapFactory.java:49)
      

      I am able to generate the file with a single heap segment (see singleheapsegment.hprof) as well as multiple heap segments (see multiheapsegment.hprof). The first one can be opened by NetBeans 12.x, the latter cannot.

       

      In my usecase I'd like to generate the file incrementally while my application is running. As such it is essential to flush the heap segments multiple times, otherwise I may run out of memory. It would be fantastic if the NetBeans heap profiler library could be enhanced to work with multiheapsegment files properly.

      Attachments

        1. multiheapsegment.hprof
          8 kB
          Jaroslav Tulach
        2. singleheapsegment.hprof
          7 kB
          Jaroslav Tulach

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jtulach Jaroslav Tulach
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h