This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 131994 - Profiler "Load Heap Dump" triggers NPE
Summary: Profiler "Load Heap Dump" triggers NPE
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
: 137749 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-03 22:59 UTC by fabriziogiudici
Modified: 2008-07-18 14:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
hprof generated under Mac OS X (554.98 KB, application/octet-stream)
2008-04-03 23:01 UTC, fabriziogiudici
Details
hprof generated under Linux (604.13 KB, application/octet-stream)
2008-04-03 23:02 UTC, fabriziogiudici
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fabriziogiudici 2008-04-03 22:59:31 UTC
The "Load Heap Dump" option doesn't work, causing an internal NPE. Tried on Mac OS X 10.5 + Java 5 + NetBeans 6.0.1 (updated to the latest patches) and 
6.1beta; and on Linux Ubuntu + Java 6 + NetBeans 6.0.1 (updated to the latest patches).

java.lang.NullPointerException
	at org.netbeans.lib.profiler.heap.HprofHeap.getClassDumpSegment(HprofHeap.java:265)
	at org.netbeans.lib.profiler.heap.HprofHeap.getJavaClassByName(HprofHeap.java:240)
	at org.netbeans.modules.profiler.heapwalk.ui.SummaryControllerUI.computeSummary(SummaryControllerUI.java:234)
	at org.netbeans.modules.profiler.heapwalk.ui.SummaryControllerUI.access$200(SummaryControllerUI.java:83)
	at org.netbeans.modules.profiler.heapwalk.ui.SummaryControllerUI$1.run(SummaryControllerUI.java:310)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Comment 1 fabriziogiudici 2008-04-03 23:01:41 UTC
Created attachment 59652 [details]
hprof generated under Mac OS X
Comment 2 fabriziogiudici 2008-04-03 23:02:31 UTC
Created attachment 59653 [details]
hprof generated under Linux
Comment 3 fabriziogiudici 2008-04-03 23:22:51 UTC
Update: it might be a problem with the heap dump, since I can't open it with jhat - it looks as it just contains "Class", "String" and "ClassLoader" (!). I 
created the dump with this ant task:

    <target name="test-profile" depends="init,aux-test-init,test-init,test-build">
        <mkdir dir="${build.test.unit.results.dir}"/>
        <junit showoutput="true" fork="true" failureproperty="tests.failed" errorproperty="tests.failed" filtertrace="${test.filter.trace}" 
tempdir="${build.test.unit.results.dir}">
            <batchtest todir="${build.test.unit.results.dir}">
                <fileset dir="${build.test.unit.classes.dir}">
                    <include name="**/*Test.class"/>
                </fileset>
            </batchtest>
            <classpath refid="test.unit.run.cp"/>
            <syspropertyset refid="test.unit.properties"/>
            <jvmarg value="-ea"/>
            <jvmarg value="-Xmx512M"/>
            <jvmarg value="-Xprof"/>
            <jvmarg value="-Xrunhprof:cpu=samples,format=b"/>
            <formatter type="brief" usefile="false"/>
            <formatter type="xml"/>
        </junit>
        <fail if="tests.failed" unless="continue.after.failing.tests">Some tests failed; see details above.</fail>
    </target>

Comment 4 Tomas Hurka 2008-04-07 13:20:01 UTC
You are right, your heap dump is empty. I will fix NPE. Lowering priority to P4.
Comment 5 Tomas Hurka 2008-06-19 18:08:59 UTC
*** Issue 137749 has been marked as a duplicate of this issue. ***
Comment 6 Tomas Hurka 2008-07-18 14:09:04 UTC
Fixed.

changeset:   90364:03a2b9d3109c
user:        Tomas Hurka <thurka@netbeans.org>
date:        Fri Jul 18 15:05:19 2008 +0200
summary:     bugfix #131994, make sure that empty heap dump is handled without NPEs