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 116375 - Take memory snapshot results in NPE
Summary: Take memory snapshot results in NPE
Status: RESOLVED WORKSFORME
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@profiler
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-09-21 20:54 UTC by _ gsporar
Modified: 2007-11-02 14:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE message log (82.19 KB, text/plain)
2007-09-21 20:54 UTC, _ gsporar
Details
messages.log (56.83 KB, text/plain)
2007-09-28 13:48 UTC, Alexander Kouznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gsporar 2007-09-21 20:54:22 UTC
Using the daily build from 2007-09-20 on JDK6u2 running on Ubuntu 7.04.

Profile the Anagram game with Memory profiling: Record object creation only, track every 1 allocations, do not record
stack traces, and do not use profiling points.

After the application starts up, click on the "New Word" button a few times.  Then click the take snapshot button.  This
is what I got:

java.lang.NullPointerException
	at com.sun.tools.profiler.ui.memory.SnapshotAllocResultsPanel.fetchResultsFromSnapshot(SnapshotAllocResultsPanel.java:62)
	at com.sun.tools.profiler.ui.memory.SnapshotAllocResultsPanel.<init>(SnapshotAllocResultsPanel.java:48)
	at org.netbeans.modules.profiler.MemorySnapshotPanel.<init>(MemorySnapshotPanel.java:112)
	at org.netbeans.modules.profiler.SnapshotResultsWindow.displayMemoryResults(SnapshotResultsWindow.java:251)
	at org.netbeans.modules.profiler.SnapshotResultsWindow.<init>(SnapshotResultsWindow.java:149)
	at org.netbeans.modules.profiler.SnapshotResultsWindow.get(SnapshotResultsWindow.java:87)
	at org.netbeans.modules.profiler.ResultsManager.openSnapshot(ResultsManager.java:715)
	at org.netbeans.modules.profiler.ProfilerControlPanel2$ResultsSnippetPanel.snapshotTaken(ProfilerControlPanel2.java:1417)
	at org.netbeans.modules.prof

I will attach the full message log.  I don't know if this is reproducible or not.
Comment 1 _ gsporar 2007-09-21 20:54:58 UTC
Created attachment 49272 [details]
IDE message log
Comment 2 J Bachorik 2007-09-24 08:34:27 UTC
Tried to reproduce with the following config:
Product Version: NetBeans IDE Dev (Build 200709200000) 
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b05 
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)

Started NB with a clean user dir, created new AnagramGame and followed your steps.
Taking snapshot was successful without any exceptions. Could you, plz, verify the issue with a clean user dir.
Comment 3 Alexander Kouznetsov 2007-09-28 13:46:15 UTC
Reproduced with
Product Version: NetBeans IDE Dev (Build 200709271200) 
Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b03 
System: SunOS version 5.10 running on x86; ISO646-US; en (nb)

Performed 2nd attempt of Sample Java Application
(http://www.netbeans.org/nonav/issues/showattachment.cgi/49733/Main.java) profiling after an failed profiling with the
following exceptions. After the application had finished Profiler failed to take snapshot and threw the NPE. The
following exceptions were thrown during previous profiling attempt (liveness memory one):

java.io.IOException: Not enough space
	at sun.nio.ch.FileChannelImpl.map0(Native Method)
	at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:742)
	at org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:304)
        ...

and

java.lang.OutOfMemoryError
	at sun.misc.Unsafe.allocateMemory(Native Method)
	at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:99)
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
	at sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:57)
	at sun.nio.ch.IOUtil.read(IOUtil.java:205)
	at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:145)
	at org.netbeans.core.output2.FileMapStorage.getReadBuffer(FileMapStorage.java:316)
        ...

See attached messages.log file
Comment 4 Alexander Kouznetsov 2007-09-28 13:48:17 UTC
Created attachment 49742 [details]
messages.log
Comment 5 Tomas Hurka 2007-09-28 18:41:57 UTC
The "java.io.IOException: Not enough space" exceptions has nothing to do with profiler. NPE can be caused by java.io.IOException. Please reproduce it without 
any previous exception.  
Comment 6 _ gsporar 2007-10-01 17:27:45 UTC
FWIW, I cannot reproduce the NPE with the daily build from 2007-09-28
Comment 7 Alexander Kouznetsov 2007-11-02 14:08:38 UTC
Closing since the issue can't be reproduced by reporter. Please reopen if reproduced again.