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 175012

Summary: OutOfMemoryError: Java heap space
Product: guibuilder Reporter: Oleg Khokhlov <ovk>
Component: CodeAssignee: Jan Stola <jstola>
Status: RESOLVED FIXED    
Severity: blocker CC: hmichel, jkovalsky
Priority: P4 Keywords: NETFIX
Version: 6.x   
Hardware: All   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=160496
Issue Type: DEFECT Exception Reporter: 160496
Attachments: stacktrace
proposed patch

Description Oleg Khokhlov 2009-10-20 14:36:45 UTC
Build: NetBeans IDE Dev (Build 200910191401)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86

User Comments:
ovk: Form file, customizeer dialog (for table), entered too high value in "Count" field in 'Rows' tab



Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2760)
        at java.util.Arrays.copyOf(Arrays.java:2734)
        at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
        at java.util.ArrayList.add(ArrayList.java:370)
        at org.netbeans.modules.form.editors2.TableModelEditor$NbTableModel.addRow(TableModelEditor.java:658)
        at org.netbeans.modules.form.editors.TableCustomizer.ensureRowCount(TableCustomizer.java:1587)
Comment 1 Oleg Khokhlov 2009-10-20 14:36:51 UTC
Created attachment 89769 [details]
stacktrace
Comment 2 Jan Stola 2009-10-20 15:09:10 UTC
Reproducible. On the other hand, this use case doesn't have much sense => lowering priority.
Comment 3 Michel Graciano 2009-10-20 16:18:56 UTC
IMHO, since it is normally for prototype, the UI should have an validation about how many rows and columns it could 
accept. If user wish to define an higher value he should define it by code which avoid OOME in IDE. Maybe we can address 
it by some NetFIX member.
Comment 4 Jiri Kovalsky 2009-10-21 21:18:08 UTC
Honza Stola agreed to review and integrate possible patch coming from the NetFIX [1] team.

[1] http://wiki.netbeans.org/NetFIX
Comment 5 Michel Graciano 2010-01-25 16:04:31 UTC
How many rows and columns should we accept?
Comment 6 Jiri Kovalsky 2010-01-26 04:47:32 UTC
I would say not to be too much restrictive it could be like 50 columns and 100 rows? Or 100 x 100 maximum?
Comment 7 dynamite 2010-03-19 20:21:36 UTC
Created attachment 95459 [details]
proposed patch

I have limited the number of rows and columns to 100.  If this is exceeded the the row/column spinner is reset to the previous safe value and an error message in red to that effect to output at the bottom of the dialog.
Comment 8 Jiri Kovalsky 2010-03-22 14:21:03 UTC
Honzo, can you please review and integrate the patch? Thanks!
Comment 9 Jan Stola 2010-03-23 16:20:26 UTC
I have applied the patch with several changes. There were few layout-related problems and it was possible to exceed the row/column limit using Insert button. These problems should be fixed now => marking the issue as fixed.

Modified files: http://hg.netbeans.org/cdev/rev/93102bad00d5
Comment 10 Jiri Kovalsky 2010-03-24 16:14:22 UTC
Thank you Honzo and thanks to Daniel for his patch!