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 243937

Summary: OutOfMemoryError: Java heap space
Product: guibuilder Reporter: vigneshArjun
Component: CodeAssignee: issues@guibuilder <issues>
Status: RESOLVED FIXED    
Severity: normal CC: sebknap
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 203976
Attachments: stacktrace
stacktrace

Description vigneshArjun 2014-04-19 12:48:01 UTC
Build: NetBeans IDE 8.0 (Build 201403101706)
VM: Java HotSpot(TM) Client VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows 7

User Comments:
GUEST: Open a java file with form builder

GUEST: e

vigneshArjun: I started working on my project. The panel wouldn't open and becpme stuck.




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75)
   at java.awt.image.Raster.createPackedRaster(Raster.java:470)
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
   at java.awt.image.BufferedImage.<init>(BufferedImage.java:338)
   at com.sun.java.swing.plaf.windows.XPStyle$SkinPainter.createImage(XPStyle.java:673)
   at sun.swing.CachedPainter.paint0(CachedPainter.java:139)
Comment 1 vigneshArjun 2014-04-19 12:48:03 UTC
Created attachment 146838 [details]
stacktrace
Comment 2 Exceptions Reporter 2014-10-14 21:31:02 UTC
Created attachment 149907 [details]
stacktrace

<Please provide a description of the problem or the steps to reproduce>

A red notification icon appeared on the bottom right hand corner of Netbeans and then i was directed to this page
Comment 3 Tomas Pavek 2015-09-10 10:05:37 UTC
The OOME happened when painting in GUI builder, but looking at the available heap dumps there is no significant memory usage from GUI builder. In fact the heap dumps don't show any obvious problem. It looks like there was not enough memory for the screen image buffer. It must have been allocated extremely large because the heap dumps show there was still enough memory free (e.g. in exception 777088 there is 150MB of data while max heap size was 910.5MB).

It is actually the TitledBorder painting that causes this problems. It can be seen in all stacktraces. I was able to get the OOME when I set a titled border to a panel of size 15,000 x 10,000. Without titled border it was fine. Size of 5,000 x 5,000 also was fine. So perhaps some people have extremely large forms and may run into this problem.

I'm afraid we can't do much with this. Hopefully it is really the extreme size case when it happens (so quite rarely). Although we can't avoid the OOME, there was recently a robustness fix in painting (https://hg.netbeans.org/web-main/rev/31714d5db182) which now actually catches the OOME so it does not jump on the user in the exception window and the GUI builder/IDE remains usable.
Comment 4 Tomas Pavek 2015-09-10 16:53:31 UTC
Bug 250695 is somewhat similar, but with tabbed pane.