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 67877 - Opening large files in the Editor takes twice as much memory (4.2 compared to 3.4)
Summary: Opening large files in the Editor takes twice as much memory (4.2 compared to...
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker with 2 votes (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-31 23:59 UTC by cahrens
Modified: 2016-07-07 07:27 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
The actual customer file was about 5 MB in size-- same pattern as this file but longer. (368.06 KB, text/plain)
2005-11-01 00:02 UTC, cahrens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cahrens 2005-10-31 23:59:52 UTC
One of our customers sent us a file (I have to figure out how to attach it) 
that he was able to open in 1.4 seconds using our Editor that was built on top 
of the NetBeans 3.4 release.  With our newer version of our Editor (based on 
4.1), the file can only be opened if the Java heap size is increased, and then 
it takes approximatley 30 seconds.

I ran the JProbe Memory Debugger to see how much memory NetBeans is using.  
With the 3.4 release, it used approximately 46,900,00 bytes of memory.  With 
4.1, 100,000,000 bytes.  These are the top memory consumers:

org.netbeans.editor.LineElement 
org.netbeans.editor.MultiMark 
char[] 
org.netbeans.editor.BasePosition 
org.netbeans.editor.Syntax$BaseSyntaxInfo 

Once it is up, 
org.netbeans.editor.DrawEngineLineView and java.awt.Rectangle move up there 
also. 

The file is slightly over 5 MB in size.

Will memory usage be reduced for the 5.0 release?
Comment 1 cahrens 2005-11-01 00:02:32 UTC
Created attachment 26507 [details]
The actual customer file was about 5 MB in size-- same pattern as this file but longer.
Comment 2 Miloslav Metelka 2005-11-01 09:23:34 UTC
Not in 5.0 but in the next version we would like to improve our view hierarchy
to only maintain the views for the visible part of the file. This should reduce
the memory consumption for the views considerably. The view hierarchy was added
in 3.6 to cover the code folding requirement. But generally the lines are
expensive in our editor (not the actual character count on the line). Objects
that model a line take roughly 100 bytes:
LineElement: 24 bytes
MultiMark: 24 bytes
BasePosition: 16 bytes
DrawEngineLineView: 32 bytes
DrawEngineLineView.ViewToModelDG: 24 bytes  (created lazily)
With the view hierarchy improvements the last two items should generally only be
created for the visible area of the file.
There is just one position created for each line element as the ending position
of preceding line is shared with starting position of the next line element.

Changing to enhancement as this is not a defect.
Comment 3 Miloslav Metelka 2006-06-28 14:24:49 UTC
Changing the milestone to Dev as the new view hierarchy together with higlight
layers are being developed in the editor_api branch and should be available for
NB 6.0.
Comment 4 Jiri Prox 2008-04-11 00:41:59 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 5 Martin Balin 2016-07-07 07:27:37 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss