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 228425 - BaseCPUCCTNode and its subclasses are using too much memory
Summary: BaseCPUCCTNode and its subclasses are using too much memory
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Hurka
URL: https://netbeans.org/projects/profile...
Keywords: VISUALVM
Depends on:
Blocks:
 
Reported: 2013-04-10 07:03 UTC by Tomas Hurka
Modified: 2014-01-24 13:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2013-04-10 07:03:42 UTC
BaseCPUCCTNode with subclasses are used to store CPU profiling data. The model is using too much memory. See attached heap dump for details.
Comment 1 Tomas Hurka 2013-04-10 08:32:07 UTC
Heap dump is available at <https://netbeans.org/projects/profiler/downloads/download/Heapdumps/heapdump-228425.7z>
Comment 2 Tomas Hurka 2013-04-11 15:49:58 UTC
The following is the top of list of classes sorted by number of instances:
java.lang.ref.WeakReference	                10,687,730 (21.4%)
BaseCPUCCTNode$ArrayChildren             10,675,607 (21.4%)
TimedCPUCCTNode$TimingDataSimple   10,675,606 (21.4%)
MethodCPUCCTNode                               10,675,605 (21.4%)
RuntimeCPUCCTNode[]                              6,362,789 (12.7%)

To lower the the memory consumption we can:
1) remove most of WeakReference instances, since every instance of MethodCPUCCTNode has one
2) ArrayChildren class can be removed and replaced by RuntimeCPUCCTNode[]
3) TimingDataSimple and TimingDataExtended can be removed and therir data merged to TimedCPUCCTNode
4) there is a lot of zero-sized RuntimeCPUCCTNode[] - these can be replaced by one instance
Comment 3 Tomas Hurka 2013-04-11 16:13:35 UTC
2) and 4) is done by:

changeset:   250247:121314b30ecb
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Apr 11 18:06:06 2013 +0200
summary:     bugfix #228425, ArrayChildren replaced by RuntimeCPUCCTNode[]; use EMPTY_CHILDREN for zero-sized children
Comment 4 Tomas Hurka 2013-04-11 18:46:21 UTC
3) was done in

changeset:   250248:f05bc3d2da73
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Apr 11 19:47:44 2013 +0200
summary:     bugfix #228425, TimedCPUCCTNode.TimingData* merged into TimedCPUCCTNode
Comment 5 Tomas Hurka 2013-04-11 18:47:25 UTC
1) was done in:

changeset:   250249:87442bc52516
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Apr 11 20:44:48 2013 +0200
summary:     bugfix #228425, BaseCPUCCTNode.factoryRef removed

All done, closing as fixed.
Comment 6 Quality Engineering 2013-04-25 02:18:53 UTC
Integrated into 'main-golden', will be available in build *201304242301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/121314b30ecb
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #228425, ArrayChildren replaced by RuntimeCPUCCTNode[]; use EMPTY_CHILDREN for zero-sized children