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 241154

Summary: OutOfMemoryError: Java heap space
Product: debugger Reporter: IrianR
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: VERIFIED FIXED    
Severity: normal CC: jzwolak
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 207122
Attachments: stacktrace

Description IrianR 2014-01-30 10:04:28 UTC
Build: NetBeans IDE Dev (Build 201401290001)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.45-b08, Java(TM) SE Runtime Environment, 1.7.0_45-b18
OS: Windows 7

User Comments:
IrianR: Tried to get a GUI snapshot of a really huge project with complex GUI just to see if it could get me a result.

This project is really a beast, and the GUI is parlty generated on the fly from configuration files and partly hand made, so there might be way more to process in there than what is normally manageable.




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.util.Arrays.copyOfRange(Arrays.java:2694)
   at java.lang.String.<init>(String.java:203)
   at java.lang.String.substring(String.java:1913)
   at org.netbeans.modules.debugger.jpda.visual.RemoteAWTScreenshot$AWTComponentInfo.<init>(RemoteAWTScreenshot.java:726)
   at org.netbeans.modules.debugger.jpda.visual.RemoteAWTScreenshot$AWTComponentInfo.<init>(RemoteAWTScreenshot.java:746)
   at org.netbeans.modules.debugger.jpda.visual.RemoteAWTScreenshot$AWTComponentInfo.<init>(RemoteAWTScreenshot.java:746)
Comment 1 IrianR 2014-01-30 10:04:29 UTC
Created attachment 144568 [details]
stacktrace
Comment 2 Martin Entlicher 2014-02-10 14:02:52 UTC
There are 3 874 instances of AWTComponentInfo and 550 thousands of instances of ComponentProperty. There's a lot of components in this snapshot and all their property objects have problem to fit into memory.
We should probably create the properties on demand only and allow them to GC when not visible.
Comment 3 Martin Entlicher 2014-04-11 21:51:54 UTC
*** Bug 243065 has been marked as a duplicate of this bug. ***
Comment 4 Martin Entlicher 2014-04-18 18:12:49 UTC
Fixed by changeset:   273873:dc611e695c51
http://hg.netbeans.org/core-main/rev/dc611e695c51
Comment 5 Quality Engineering 2014-04-20 01:24:05 UTC
Integrated into 'main-silver', will be available in build *201404200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dc611e695c51
User: mentlicher@netbeans.org
Log: #241154: Solve OOME by creating ComponentProperties on demand and assuring the DebugTreeView does not hold the nodes from the last debug session.
Comment 6 Martin Entlicher 2014-04-22 08:17:44 UTC
Verified in a profiler.
Comment 7 IrianR 2014-04-22 08:22:48 UTC
I'll try to take the same insane GUI snapshot that generated the error in the first place later today with the latest DEV build and report back.
Comment 8 Martin Entlicher 2014-04-22 08:23:34 UTC
Transplanted into release80 as changeset:   282895:6a32ba0c1664
http://hg.netbeans.org/releases/rev/6a32ba0c1664
http://hg.netbeans.org/releases/rev/01de03d46c7f
Comment 9 Martin Entlicher 2014-04-22 08:23:59 UTC
O.K. Thanks.
Comment 10 IrianR 2014-04-22 12:17:01 UTC
(In reply to Martin Entlicher from comment #9)
> O.K. Thanks.

I've tried to take another snapshot of the same application that generated the error in the first place and got another OOM.

Upload of the logs is still in progress, my network is taking it's sweet time today.
Comment 11 IrianR 2014-04-22 12:36:36 UTC
(In reply to IrianR from comment #10)
> (In reply to Martin Entlicher from comment #9)
> > O.K. Thanks.
> 
> I've tried to take another snapshot of the same application that generated
> the error in the first place and got another OOM.
> 
> Upload of the logs is still in progress, my network is taking it's sweet
> time today.

logs upload has completed now, the exception reporter created a new Bug 243993 for this, and by looking at the first lines of the stack trace it seems it's right since the debugger is no longer involved.
Comment 12 Quality Engineering 2014-04-24 02:13:47 UTC
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/6a32ba0c1664
User: mentlicher@netbeans.org
Log: #241154: Solve OOME by creating ComponentProperties on demand and assuring the DebugTreeView does not hold the nodes from the last debug session.
(transplanted from dc611e695c519aa6d56f783b8bb5896e2295ed0b)
Comment 13 Jiri Kovalsky 2014-04-24 13:32:52 UTC
Hello Luca, can you please install Patch 1 [1] to your 8.0 and verify that the fix was successful? Thanks a lot!

[1] http://dlc.sun.com.edgesuite.net/netbeans/updates/8.0/uc/final/distribution/catalog_stage.xml.gz
Comment 14 IrianR 2014-04-24 13:52:03 UTC
(In reply to Jiri Kovalsky from comment #13)
> Hello Luca, can you please install Patch 1 [1] to your 8.0 and verify that
> the fix was successful? Thanks a lot!
> 
> [1]
> http://dlc.sun.com.edgesuite.net/netbeans/updates/8.0/uc/final/distribution/
> catalog_stage.xml.gz

I'll try but I'm a little short on time today, so I'll be able to do the test this saturday.

If everything goes as in the development version I'll have a duplicate of Bug 243993 to report by then.
Comment 15 Jiri Kovalsky 2014-04-24 14:18:05 UTC
OK, thanks for your quick reply.
Comment 16 Jiri Kovalsky 2014-04-27 18:56:56 UTC
Martin, it seems like the fix was not successful. See bug #244108.