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 191015 - Heap growth over time
Summary: Heap growth over time
Status: STARTED
Alias: None
Product: ide
Classification: Unclassified
Component: Performance (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2010-10-14 22:16 UTC by Jesse Glick
Modified: 2012-06-11 08:03 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Heap histograms before and after restart (142.35 KB, application/x-bzip2)
2010-10-14 22:16 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-10-14 22:16:28 UTC
Created attachment 102420 [details]
Heap histograms before and after restart

For the past couple of months (?) I have found that the IDE gradually consumes more and more heap over time. Even though my max heap is 512Mb, which should be plenty, after a couple hours my consumed heap remains in the high 400's, and garbage collection occupies so much time that the IDE is unusable.

Attaching two (live) heap histograms, one before shutdown, one soon after restart with the same open projects and files (14 Maven projects and 23 NBM projects), with scanning complete. Obviously after restart I have not yet run external processes or used various IDE features, so it is to be expected that heap consumption is significantly lower. Yet there are some notable differences that should not obviously result from extended IDE usage; in particular, the old dump seems to have a lot of javac-related objects, and a lot of editor.lib.impl.MultiMark's.

Since this problem occurs pretty regularly for me these days, I can probably reproduce it and do more in-depth analysis. Directly examining "old" heap dumps in the Profiler (or jhat) is difficult, since they are so big they tend to overwhelm these tools, but if there is a very specific area to investigate (e.g. typical content of all those String's) I can probably do it. Are there any tools which take a large dump as input, and using bounded memory themselves, construct summaries of interesting objects occurring in large numbers like String, File, Map<String,?>, etc.?
Comment 1 Jesse Glick 2010-10-15 19:43:48 UTC
Bug #189905 was probably a contributor, as was bug #191040, and bug #191041. (I have recently started running with the enterprise cluster enabled to help test Maven EE functionality, and apparently this code is full of leaks.) Also bug #191042. I tried to do some fixes in code I knew better: core-main #738fe6e17fa5, core-main #574c55def8b7, core-main #e8b2c6684490.

But we clearly need some more automated mechanism for detecting & reporting project memory leaks. Perhaps in development builds, when the IDE shuts down, after all processes are terminated and all TopComponent references cleared, if any Project instances are still held (and not discarded by a GC), use INSANE to try to find strong root reference chains and report them using profileme?
Comment 2 Petr Cyhelsky 2012-06-11 08:03:16 UTC
seems more like task, we will try to work on this for 7.3