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 106965 - whopping memory leak
Summary: whopping memory leak
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P1 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: PERFORMANCE
Depends on: 57664
Blocks: 106361
  Show dependency tree
 
Reported: 2007-06-18 10:54 UTC by infrid
Modified: 2008-12-22 14:41 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Apple desktop integration module sans the font hack - replace the copy in $NB_HOME/platform7/modules to use (32.71 KB, application/octet-stream)
2007-07-31 15:43 UTC, _ tboudreau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description infrid 2007-06-18 10:54:35 UTC
Hi there, I use netbeans standalone ruby ide on osx 10.4.9. Just thought u should know that whenever I leave it on for
any length of time, it ends up using about a gb of ram!!!

I then close it, start again, and it uses 150mb.. I wouldn't mind,but because the ide doesn't remember what folders I
have to open, I then have to waste time reloading, and, opening up all my folders in the project and file views.

Sorry if this is a duplicate. I'll try and clarify more if I get more info.

atb,

George.
Comment 1 Torbjorn Norbye 2007-06-18 12:20:59 UTC
Upgrading to P1.

I'm not sure if this is a leak in the Ruby or Schliemann code, or if it's the same as the problem I'm seeing as a result of issue 74714.

Recently, the startup flags (memory sizing and garbage collector flags) were changed in NetBeans. This makes Netbeans work better on Windows and 
Linux, but on the Mac, the flags seem to have caused VM instability. I'm getting VM crashes regularly if I leave the IDE and come back - and I've also seen 
1gb+ -actual- memory usage on the netbeans process (2g+ virtual memory size). This however was using Java support only - not Ruby, which if it's the 
same bug as what you're encountering, means it's probably related to the vm sizing or gc flags, not any specific leaks in the Ruby code. Also, I started 
seeing this behavior right around the time the memory flags change was integrated.

On the other hand, you're using the ruby-only-ide, which does NOT use the same garbage collection flags as the IDE; it may be using some of the sizing 
flags (same script, nbexec), but it should be skipping that code since our nbrubyide.conf specifies a maximum heap size.  Is this a recent regression, or 
have you been observing this all along? You're also saying that bringing the nbrubyide back up makes it use 150mb. That's quite a lot; I'm wondering what 
it is you do to get it that high. How many (roughly) files do you have open? What kinds of files? Do you perform any other tasks before you're seeing it 
using 150mb - such as verson control, or debugging, or is it simply restarting the IDE and having it reopen a bunch of windows?

When you're saying "leave it on for any length of time", how much time are we talking about, and do you mean during active usage of the IDE, or just 
leaving it idle and returning to it later?
Comment 2 Torbjorn Norbye 2007-06-25 21:10:52 UTC
I've established with some follow-up mail that this is not Ruby specific; the same memory behavior happens even with just the Welcome screen, or also with 
just Java editing.

The bigger problem is that the IDE will also coredump after a while. My personal suspicion is that this is related to the change in memory garbage collection 
flags which occurred around the same time I started observing crashes.

Reassigning to core since I can't think of a more suitable place for this issue to live; I'm not sure where the platform GC flags etc. belong.
Comment 3 Marian Mirilovic 2007-06-26 08:50:43 UTC
Reassign to Radim - author of Xmx/GC changes
Comment 4 _ rkubacki 2007-06-26 10:34:47 UTC
Passing to Petr who already spent some time on it.
Comment 5 Petr Nejedly 2007-06-26 15:30:42 UTC
Experiments on our side are just running.
You can also try disabling memory meter on your side to check whether it makes a difference.
Comment 6 Petr Nejedly 2007-06-28 09:01:40 UTC
I just disabled CMS and heap autosizing on Mac, it should improve the situation:
Trunk: ide/launcher/unix/netbeans,v1.49
M10: ide/launcher/unix/netbeans,v1.48.2.1
Comment 7 Peter Pis 2007-06-28 16:00:32 UTC
Could you please verify this issue for the latest M10 build? Thanks.
Comment 8 jag 2007-07-19 18:58:38 UTC
I'm finding that after using M10 for a day or two, NetBeans' address space grows to 2Gig-ish -- at which point it's thrashing and running so slowly that I have 
to restart it...  It's listed as "resolved" in M10, but I'm using M10 and the problem is still there.
Comment 9 _ tboudreau 2007-07-19 19:56:52 UTC
I'm still having this problem in recent daily builds.  It's not possible to use NetBeans for more than a few hours on my macbook before needing to restart.
Comment 10 Petr Nejedly 2007-07-31 15:17:36 UTC
The problem is very likely related to the workaround of issue 57664.
Comment 11 _ tboudreau 2007-07-31 15:41:02 UTC
FYI, I'm testing disabling the hack from issue 57664 (disables font finalizers to work around a bug in the 1.4 apple vm, which may not be necessary on 1.5).  

Since that's one place where we are intentionally causing a native resource leak (it beats repeated vm crashes when a font object disposes a native handle that 
another font object is still trying to use), it could possibly be our culprit.
Comment 12 _ tboudreau 2007-07-31 15:43:26 UTC
Created attachment 45949 [details]
Apple desktop integration module sans the font hack - replace the copy in $NB_HOME/platform7/modules to use
Comment 13 _ tboudreau 2007-08-01 18:47:14 UTC
Using the modified apple menu module w/ the font workaround removed, I ran NetBeans for seven hours yesterday w/o any of the ferocious problems with 
memory consumption I'd had, which usually made it useless after about 45 minutes.  Memory consumption does grow over time, so it is surely not the only 
leak, but it's a vast improvement.

So I've commented out the font hack - the JVM crash problems it worked around do not seem to be present on 1.5 on Mac OS, and we're requiring >=1.5 
as of NetBeans 6.

I know some parts of the *platform* are still used on 1.4 at least until recently;  if this is an issue, we can modify it to detect 1.4 and still do the hack there, 
where it does not cause quite such trouble and solves a serious problem.

IDE:-------------------------------------------------
IDE: [8/1/07 10:43 AM] Committing "Install.java" started
Checking in Install.java;
/cvs/core/applemenu/src/org/netbeans/modules/applemenu/Install.java,v  <--  Install.java
new revision: 1.3; previous revision: 1.2
done
IDE: [8/1/07 10:43 AM] Committing "Install.java" finished
Comment 14 Petr Nejedly 2007-08-23 16:21:59 UTC
Note that I have re-enabled the memory autosizing and CMS on Mac after fixing this problem the right way.
See the issue 112986.