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 240388 - [80cat] OutOfMemoryError: Java heap space while configuring JavaFX Scene Builder in Options
Summary: [80cat] OutOfMemoryError: Java heap space while configuring JavaFX Scene Buil...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
: 239567 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-13 07:01 UTC by Lou Dasaro
Modified: 2014-02-19 07:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 202166


Attachments
stacktrace (2.54 KB, text/plain)
2014-01-13 07:01 UTC, Lou Dasaro
Details
Slowness snapshot extracted from the heap dump (113.03 KB, application/octet-stream)
2014-01-13 10:00 UTC, Tomas Hurka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lou Dasaro 2014-01-13 07:01:00 UTC
Build: NetBeans IDE 8.0 Beta (Build 201401091443)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b63, Java(TM) SE Runtime Environment, 1.8.0-ea-b121
OS: Linux

User Comments:
mr_lou_d: In tools->options->java JavaFX tab, was browsing file system for Scene Builder home

GUEST: swapping system;




Stacktrace: 
java.lang.OutOfMemoryError: Java heap space
   at java.io.ObjectOutputStream$HandleTable.growEntries(ObjectOutputStream.java:2347)
   at java.io.ObjectOutputStream$HandleTable.assign(ObjectOutputStream.java:2276)
   at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1428)
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
   at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
   at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
Comment 1 Lou Dasaro 2014-01-13 07:01:02 UTC
Created attachment 143881 [details]
stacktrace
Comment 2 Lou Dasaro 2014-01-13 08:22:19 UTC
On Ubuntu 12.04 with NetBeans 8.0 Beta and Java 1.8.0ea-b121,
Configure JavaFX Scene Builder in Options - Out of heap space

NetBeans Error Report Upload Complete It has been added to the database with id#706610, it has been classified as a duplicate of Bug 202166
Comment 3 Tomas Hurka 2014-01-13 10:00:54 UTC
Created attachment 143884 [details]
Slowness snapshot extracted from the heap dump

OOME is caused by very deep stack traces in "Folder recognizer" thread and also
by the fact that IDE was running with only 400M Xmx. However I was able to
extract the slowness snapshot from the heap dump and I will attach it to this
issue.
Comment 4 Tomas Hurka 2014-01-13 10:02:04 UTC
It looks similar to issue #239567.
Comment 5 Jaroslav Havlin 2014-01-14 07:41:25 UTC
(In reply to Tomas Hurka from comment #3)
> However I was able to extract the slowness snapshot from the heap dump
> and I will attach it to this issue.
Thank you very much.

It seems that the slowness is caused by a chain of "refreshTask" tasks in "FolderList" (connected with reference "previous").

The javadoc says that previously scheduled "refreshTask" should be cancelled, but it is not implemented in the code. So if "changeComparator" is called several times, a long chain of tasks (that need to be processed and finished) can be created.

However, I haven't been able to reproduce the bug yet, I'll debug the code to ensure the hypothesis is correct.

Lou Dasaro, can you reproduce the bug every time you browse the file system for Scene Builder?
Did you set custom sorting (by last modification time, by extension) on some folder related to JavaFX (Scene Builder home, JavaFX projects)?
Thank you.
Comment 6 Jaroslav Havlin 2014-01-14 12:33:11 UTC
Reproduced. Activation of modules produces a lot of FileEvents with null name (adding entries to System Filesystem, e.g. to main menu), which causes FolderList.changeComparator to be called many times.
Comment 7 Jaroslav Havlin 2014-01-14 12:35:31 UTC
*** Bug 239567 has been marked as a duplicate of this bug. ***
Comment 8 Lou Dasaro 2014-01-14 15:18:00 UTC
Sorry I couldn't get to this last night. 
Jaroslav, yes it appears that this OOME occurs after activation of JavaFX, and before I start browsing the file system for an alternate Scene Builder in Options->Java JavaFX. Physical system only has 2GB RAM, but this has not presented a problem developing small/medium size JavaFX projects under 7.3.x and 7.4.

Steps to reproduce:
With a clean userdir and cachedir, start NetBeans Beta "All" distribution.
Invoke Tools->Options->Java and click the JavaFX tab.
Activate button appears. Click the Activate button.
System responds "Activating JavaFX 2" and then "Starting Modules"
Dialog disappears and reappears.

At this point the underlying main window responds "Saving snapshot", and eventually gets to 59% at which it appears to freeze while the memory available starts at approximately 58/230.5MB and gradually rises to 80-something and settles at 60.5. After an hour I gave up. Let me know if you need more logs.
Comment 9 Jaroslav Havlin 2014-01-16 09:02:08 UTC
http://hg.netbeans.org/core-main/rev/b61fc45da86c
Fixed, hopefully.

Lou Dasaro, it would be great if you can verify the fix, after it is integrated into the development build.

Thank you very much for reporting and help.
Comment 10 Quality Engineering 2014-01-17 02:47:07 UTC
Integrated into 'main-silver', will be available in build *201401170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b61fc45da86c
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #240388: OOME - Java heap space while configuring JavaFX Scene Builder in Options