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 95198 - OutOfMemoryError after opening one file in editor
Summary: OutOfMemoryError after opening one file in editor
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@java
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-02-12 09:06 UTC by Marian Mirilovic
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
the file - causing OOME (14.35 KB, text/plain)
2007-02-12 09:07 UTC, Marian Mirilovic
Details
heap-histogram 1 (304.87 KB, text/plain)
2007-02-12 09:09 UTC, Marian Mirilovic
Details
heap-histogram 2 (364.08 KB, text/plain)
2007-02-12 09:09 UTC, Marian Mirilovic
Details
message.log (81.40 KB, text/plain)
2007-02-12 09:58 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2007-02-12 09:06:31 UTC
I've got an email from one of our customer :
-----------------
Specifically my problem is that NetBeans memory usage can go from around 60MB to
300 or over 500MB of memory by opening a single source file in some cases.

Unfortunately, I have not managed to recall a case where I can reproduce an
out-of-memory today, but I have managed to repeatedly produce a spike from 60MB
to around 320MB by opening a single source file.  I have attached the source
file as well as before and after memory histograms and the NetBeans log file.
-----------------
Comment 1 Marian Mirilovic 2007-02-12 09:07:24 UTC
Created attachment 38339 [details]
the file - causing OOME
Comment 2 Marian Mirilovic 2007-02-12 09:09:30 UTC
Created attachment 38340 [details]
heap-histogram 1
Comment 3 Marian Mirilovic 2007-02-12 09:09:44 UTC
Created attachment 38341 [details]
heap-histogram 2
Comment 4 Marian Mirilovic 2007-02-12 09:58:51 UTC
Created attachment 38344 [details]
message.log
Comment 5 Petr Nejedly 2007-02-12 10:49:24 UTC
I originally thought there is a leaked java parser or something, but there were
only 4 javac.Name[] instances - only 4 live parser contexts, I'd say.
So the parser is parsing too much data for some reason (it shouldn't AFAIK - it
should resolve against known symbols in MDR).

It might be an issue with MDR broken or something like this. In such case I'd
suggest the user to first try deleting $userdir/var/cache, or eventually
reproducing against completly clean userdir.
I can hardly get to the same state as the user, as the attached source is not
the problematic thing alone, it has dependencies (wt.*) that make the impact.
Comment 6 Marian Mirilovic 2007-02-13 08:23:16 UTC
Comments from Jess:
-----------
I deleted cache/*, let the scan complete, shutdown the IDE (to let everything
close), opened the IDE, let the re-scan complete, and then opened the file.  I
did all of this in Java 5 (1.5.0_11) in this case.  [I'd previously tested with
both Java 5 and Java 6.]

This time the full heap was consumed as best I could tell (I had allocated 352MB
in this case).  I didn't get a clear OutOfMemory in the GUI, but I did get

    ErrorChecker: Java heap space

in the log file.
-----------------
Also, in case it is of interest the mdrstorage directory contains 89.5 MB of
stuff after the clean MDR rebuild. 
-----------------
Comment 7 Tomas Zezula 2007-02-16 14:45:02 UTC
Probably already fixed when MDR based model was replaced by the javac based
model. I will try to open the attached file.
Comment 8 Tomas Zezula 2007-02-16 14:49:54 UTC
Fixed by new javac based model.
Comment 9 jessholle 2007-02-16 15:23:40 UTC
I think this issue has much more to do with the size of my projects and their
metadata than simply the single source file in question.  Unfortunately with
~30K classes, dozens of projects, and dozens and 3rd-party libraries, this is
not something I can readily share.

It could *very* well be that the new javac-based model in NetBeans 6 addresses
the issue.  That's a great resolution *if* NetBeans 6 reaches the functionality
and stability level of NetBeans 5.5 soon.  If not, then this having to wait for
NetBeans 6 to stabilize may quite frankly force some users to switch to Eclipse.
Comment 10 Marian Mirilovic 2007-03-01 09:55:05 UTC
Jess, have you tried last NB 6.0 Milestone 7 build ? 
It's available http://wiki.netbeans.org/wiki/view/MilestoneDownloads
Comment 11 Marian Mirilovic 2007-04-06 08:13:30 UTC
verified
Comment 12 jessholle 2007-04-06 12:53:11 UTC
I admit I've had other distractions that have kept me from trying this with NB 6
milestones, but I'm curious how the fix was verified.
Comment 13 Quality Engineering 2007-09-20 09:43:31 UTC
Reorganization of java component