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 200273

Summary: NullPointerException when profiling through VisualVM
Product: profiler Reporter: david.jurgens
Component: BaseAssignee: issues@profiler <issues>
Status: RESOLVED DUPLICATE    
Severity: normal Keywords: VISUALVM
Priority: P3    
Version: 7.1   
Hardware: Other   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description david.jurgens 2011-07-20 21:41:31 UTC
I was using jvisualvm to profile a multi-threaded application on a Linux system running the latest Java version:

$ java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

During profiling, I noticed that the UI would no longer let me click "settings" on the Profiler tab, although it would still profile.  When I returned to my application, I noticed the following exception reported for the profiler on my program's output:

Exception in thread "WorkerThread-2" java.lang.NullPointerException
        at org.netbeans.lib.profiler.server.ProfilerRuntimeCPU.copyLocalBuffer(ProfilerRuntimeCPU.java:240)
        at org.netbeans.lib.profiler.server.ProfilerRuntimeCPU.writeTimeStampedEvent(ProfilerRuntimeCPU.java:565)
        at org.netbeans.lib.profiler.server.ProfilerRuntimeCPUFullInstr.methodExit(ProfilerRuntimeCPUFullInstr.java:212)
        at gnu.trove.impl.hash.THash.computeMaxSize(THash.java:351)
        at gnu.trove.impl.hash.THash.setUp(THash.java:299)
        at gnu.trove.impl.hash.TPrimitiveHash.setUp(TPrimitiveHash.java:134)
        at gnu.trove.impl.hash.TIntHash.setUp(TIntHash.java:151)
        at gnu.trove.impl.hash.THash.<init>(THash.java:138)
        at gnu.trove.impl.hash.THash.<init>(THash.java:105)
        at gnu.trove.impl.hash.TPrimitiveHash.<init>(TPrimitiveHash.java:69)
        at gnu.trove.impl.hash.TIntHash.<init>(TIntHash.java:66)
        at gnu.trove.set.hash.TIntHashSet.<init>(TIntHashSet.java:60)
        at <snip...>

I was using the GNU Trove collections, if that helps.  It seems that all four of my threads had the same exception at ProfilerRuntimeCPUFullInstr.methodExit, although at different execution stacks for each thread.  

I tried re-running the program several times but haven't been able to reproduce the error with any reliability.  (Although I still can't seem to select the "Setting" subwindow when profiling this application.)
Comment 1 Tomas Hurka 2012-11-08 10:36:34 UTC

*** This bug has been marked as a duplicate of bug 207632 ***