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 244697 - OOM - CssFileModel$LazyEntry keeps CssFileModel and CssParserResult
Summary: OOM - CssFileModel$LazyEntry keeps CssFileModel and CssParserResult
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Editor (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
: 236915 238176 239336 240158 240946 242379 243373 244807 249469 252812 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-23 15:03 UTC by Exceptions Reporter
Modified: 2015-06-04 15:52 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 209895


Attachments
stacktrace (326 bytes, text/plain)
2014-05-23 15:03 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2014-05-23 15:03:11 UTC
This issue was reported manually by thurka.
It already has 1 duplicates 


Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.51-b03, Java(TM) SE Runtime Environment, 1.7.0_51-b13
OS: Linux

User Comments:
GUEST: ?? ????




Stacktrace: 
java.lang.OutOfMemoryError: GC overhead limit exceeded
   at java.util.concurrent.locks.ReentrantLock$Sync.newCondition(ReentrantLock.java:172)
   at java.util.concurrent.locks.ReentrantLock.newCondition(ReentrantLock.java:503)
   at javax.swing.TimerQueue.run(TimerQueue.java:192)
   at java.lang.Thread.run(Thread.java:744)
Comment 1 Exceptions Reporter 2014-05-23 15:03:13 UTC
Created attachment 147415 [details]
stacktrace
Comment 2 Tomas Hurka 2014-05-23 15:06:27 UTC
Retained size of 37 instances of org.netbeans.modules.css.lib.nbparser.CssParser is 529,406,600 bytes, which is 61% of a whole heap size.
Comment 3 Petr Cyhelsky 2014-05-30 10:29:14 UTC
*** Bug 244807 has been marked as a duplicate of this bug. ***
Comment 4 Marek Fukala 2014-07-22 12:34:58 UTC
Two problems here:

1) o.n.m.css.refactoring.api.EntryHandle holds an implementation (CssFileModel$LazyEntry) of o.n.m.css.refactoring.api.Entry which holds its outer class org.netbeans.modules.css.indexing.CssFileModel which holds CssParserResult.

I reckon this is not a severe problem as the EntryHandle-s are used just within the refactoring support. I do not assume the will be too many of these held via the refactoring UI(s).


2) CssRuleStructureItem is not a true handle but directly keeps reference to CssNodeElement which then indirectly holds CssParserResult and all related objects.

This seems to be the sore point and very likely the cause of all the OOMs as the navigator UI can hold many such objects from various generations of the parser results. Each such object then keeps its parser result and all related stuff.
Comment 5 Marek Fukala 2014-07-22 12:36:24 UTC
*** Bug 239336 has been marked as a duplicate of this bug. ***
Comment 6 Marek Fukala 2014-07-22 12:38:21 UTC
*** Bug 243373 has been marked as a duplicate of this bug. ***
Comment 7 Marek Fukala 2014-07-22 12:56:49 UTC
*** Bug 242379 has been marked as a duplicate of this bug. ***
Comment 8 Marek Fukala 2014-07-24 15:11:50 UTC
*** Bug 236915 has been marked as a duplicate of this bug. ***
Comment 9 Marek Fukala 2014-07-24 15:16:47 UTC
*** Bug 238176 has been marked as a duplicate of this bug. ***
Comment 10 Marek Fukala 2014-07-25 07:18:06 UTC
issue #1 fixed

changeset:   276082:0b9cf2f75d41
summary:     #244697 - CssFileModel$LazyEntry is a static inner class so it doesn't hold the CssFileModel itself
Comment 11 Marek Fukala 2014-07-25 07:38:19 UTC
As for issue #2 (CssNodeElement) -- the evaluation was not correct. The CssNodeElement is correct, it holds just the file and pair of offsets.
Comment 12 Marek Fukala 2014-07-25 07:43:09 UTC
report 720692 - what looks very wrong is that the ClassMemberPanelUI$MyBeanTreeView (the navigator) holds 262144 items (VisualizerNode) which then holds the ElementScanningTask$RootStructureItem which holds all the css StructureItems. This seems to be a bug in the CLS's navigator implementation.
Comment 13 Marek Fukala 2014-07-25 07:52:55 UTC
changeset:   276111:6e09b3a36a70
summary:     #244697 - fixing bug: TopLevelStructureItem$Rules keeps reference to FeatureContext which then does hold the CssParserResult
Comment 14 Marek Fukala 2014-07-25 08:02:43 UTC
As for the ClassMemberPanelUI$MyBeanTreeView memory leak, I've filled a new issue against CSL:

https://netbeans.org/bugzilla/show_bug.cgi?id=245980
Comment 15 Marek Fukala 2014-07-25 08:20:42 UTC
*** Bug 240946 has been marked as a duplicate of this bug. ***
Comment 16 Marek Fukala 2014-07-25 10:13:59 UTC
*** Bug 240158 has been marked as a duplicate of this bug. ***
Comment 17 Quality Engineering 2014-07-26 01:24:03 UTC
Integrated into 'main-silver', will be available in build *201407260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0b9cf2f75d41
User: Marek Fukala <mfukala@netbeans.org>
Log: #244697 - CssFileModel$LazyEntry is a static inner class so it doesn't hold the CssFileModel itself
Comment 18 Jaroslav Havlin 2014-12-22 16:49:53 UTC
*** Bug 249469 has been marked as a duplicate of this bug. ***
Comment 19 Tomas Hurka 2015-06-04 15:52:46 UTC
*** Bug 252812 has been marked as a duplicate of this bug. ***