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 50226 - Code folding in Java editor needs a lot of memory
Summary: Code folding in Java editor needs a lot of memory
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 4.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-10-11 14:13 UTC by _ rkubacki
Modified: 2009-11-02 10:59 UTC (History)
2 users (show)

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 _ rkubacki 2004-10-11 14:13:54 UTC
Both NbJavaFoldManager$ImportsFoldInfo and
NbJavaFoldManager$InitialFoldInfo keep start and
end position in document that is also held by the
fold. Similarly for javadoc folds

hasmap init2folds uses String version of MOFID as
a key. This is expensive as the string is 53 chars
long and keeps 112+24 bytes. The value again
references mofid from ClassMemberFoldInfo.id and
through ClassMemberFoldInfo.classMember.mofId too.
Using MOFID object as a key would be enough but
requires it was a part of API.
Comment 1 Miloslav Metelka 2004-10-12 13:25:54 UTC
Regarding the first problem this is IMHO irrelevant for the two
mentioned classes as they are only held during the pending
UpdateFoldsRequest then they should be released and only the fold
itself should remain until there is a need to create another request.

 To clarify the process: the updating of the folds is done in two phases:
 1) collect all the information necessary for folds creation or
changing; this has to run outside of the AWT thread - in a dedicated
RequestProcessor
 2) update the folds in the copmonent's fold hierarchy; this has to
run in AWT; it uses the information stored in the UpdateFoldsRequest
created in the phase 1)

What could be eliminated are the
NbJavaFoldManager$ClassMemberFoldInfo.classMemberStartPos and others
but only once the phase 2) finishes. I'll try to look at that whether
it would not break anything.

Regarding 2) this is IMHO not an editor's issue. We only need to keep
some identity of the folds and use it in maps too but we don't really
care whether it's String or anything else.
Comment 2 Vitezslav Stejskal 2007-10-19 13:46:55 UTC
Do we still have this problem? We don't use MOFIDs anymore AFAIK. Can we remeasure it again? Thanks
Comment 3 Jan Lahoda 2007-10-19 13:53:04 UTC
We still hold the positions. I do not think we hold any equivalent of MOFID.
Comment 4 Jan Lahoda 2008-11-19 12:26:57 UTC
later.
Comment 5 Quality Engineering 2009-11-02 10:59:21 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX