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 74196 - Saved snapshot after out of memory error
Summary: Saved snapshot after out of memory error
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Sedlacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-30 13:01 UTC by ehucka
Modified: 2007-02-20 18:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehucka 2006-03-30 13:01:45 UTC
I tried to save a big snapshot and it threw 'out of memory event' and some
message that I need to increase xmx parameter next time. Ok. But after this
event the snapshot was added into snapshots list and the 'unsaved star' in its
title disappered.
I closed the snapshot and tried to open the snapshot from snapshots list but it
threw:

Annotation: Error while loading snapshot: The file is not a valid NetBeans
Profiler Snapshot file.
java.io.IOException: The file is not a valid NetBeans Profiler Snapshot file.
org.netbeans.modules.profiler.LoadedSnapshot.load(LoadedSnapshot.java:240)
org.netbeans.modules.profiler.LoadedSnapshot.loadSnapshot(LoadedSnapshot.java:354)
org.netbeans.modules.profiler.ResultsManager.loadSnapshot(ResultsManager.java:388)
org.netbeans.modules.profiler.ResultsManager.loadSnapshots(ResultsManager.java:366)
org.netbeans.modules.profiler.ProfilerControlPanel2$SnapshotsPanel.loadSelectedSnapshots(ProfilerControlPanel2.java:878)
org.netbeans.modules.profiler.ProfilerControlPanel2$SnapshotsPanel.access$3200(ProfilerControlPanel2.java:616)
org.netbeans.modules.profiler.ProfilerControlPanel2$SnapshotsPanel$4.mousePressed(ProfilerControlPanel2.java:770)

I think if there occures an error during saving of a snapshot it should rollback
and get into the state before saving.
Comment 1 Jiri Sedlacek 2006-06-07 14:39:28 UTC
Now snapshotSaved event is fired only if snapshot is correctly saved, otherwise 
corrupted file is deleted.

Fixed in trunk.
Comment 2 Jiri Sedlacek 2006-06-07 14:46:05 UTC
Fixed in release55 branch.
Comment 3 ehucka 2006-07-26 10:18:42 UTC
verified
Comment 4 ehucka 2006-07-26 11:54:27 UTC
mistake, it doesn't work in profiler 5.5
Comment 5 ehucka 2006-07-26 12:46:17 UTC
in trunk too
Comment 6 Jiri Sedlacek 2006-08-08 14:44:44 UTC
Don't know what exactly now doesn't work for you after the fix, I've 
experienced no problems saving snapshots. Please describe exact steps how to 
reproduce and concrete problem - buggy behavior, expected behavior.
Comment 7 ehucka 2006-08-08 15:52:58 UTC
I can reproduce it by simulation:

1. set -xmx to 96 megs
2. create JSP sample project
3. start profiling - memory profiling, including allocation stacktraces
4. wait until the application is started
5. take snapshot
6. wait the ide is using about 90 mb
7. save snapshot

Profiler informs the snapshot cannot be saved because there is not enough memory
but something is saved - Saved Snapshots list contains a new item without icon.
After opening of this item it throws error message 'it is not a valid profiler
snapshot file.'
Expected behaviour is to not create corrupted snapshot files in this state.

Comment 8 Jiri Sedlacek 2006-08-09 17:16:08 UTC
Thanks for the steps, now I'm able to reproduce and fix.

Should be now correctly fixed in trunk. Please verify before merging to 
release55 branch.
Comment 9 ehucka 2006-09-11 18:36:06 UTC
verified in trunk
Comment 10 Jiri Sedlacek 2006-10-04 16:44:21 UTC
Merged into release55 branch.
Comment 11 Tomas Hurka 2006-10-04 17:14:14 UTC
Fix reviewed and it is OK.
Comment 12 ehucka 2006-10-05 08:48:20 UTC
verified in 5.5 rc2 build 061005
Comment 13 Alexander Kouznetsov 2007-02-20 10:27:00 UTC
Closing old issues
Comment 14 Alexander Kouznetsov 2007-02-20 18:16:22 UTC
Reverting to original Target Milestone value changed by mistake. Sorry for
inconvenience.