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 36754 - Localizers cause higher memory consumption
Summary: Localizers cause higher memory consumption
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2003-10-22 14:41 UTC by Petr Nejedly
Modified: 2007-11-05 13:44 UTC (History)
0 users

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 Petr Nejedly 2003-10-22 14:41:09 UTC
The localizer for options package alone consumes
about ~130KB of heap, while other localizers
onsume additional ~50KB. Especially in the case of
options, this is clearly waste, as the localizer
is hardly used during normal usage. It should be
possible to rearrange the localizer implementation
to not keep the bundle in memory (e.g. use
NbBundle.getMessage(bundleClass, key) instead of
bundle.getString).
But keep in mind that the localizers are chained,
it is needed to arrange them so the options
localizer will be the last asked (or generally
order them by hit probability).
The goal is to:
1. Not keep options localizer in memory
2. Not parse it during startup

Please note that the NbBundle managed bundles are
cached using TimedSoftReference, so there
shouldn't be any new performance problem.
Comment 1 Miloslav Metelka 2004-01-22 13:54:42 UTC
In the long-term we would like to get rid of the whole LocaleSupport
completely. However it will require significant changes.

I will try to make changes even for 3.6 but I cannot guarantee whether
it will be OK (e.g. from a performance point of view etc.) so I'm
leaving promoD as target for now.
Comment 2 Miloslav Metelka 2004-02-03 14:54:01 UTC
I've done two changes:
1) removed cache for retrieved strings in LocaleSupport
2) bundle class is stored insdide NbLocalizer instead of the actual
bundle.

Both changes seem to have no or little negative impact on performance.
They should have positive effect on memory consumption though.
I've tested overall editor performance, file opening, find dialog and
tools->options->editor settings appearance.

Integrated in maintrunk:
Checking in libsrc/org/netbeans/editor/LocaleSupport.java;
/cvs/editor/libsrc/org/netbeans/editor/LocaleSupport.java,v  <-- 
LocaleSupport.java
new revision: 1.12; previous revision: 1.11
done
Processing log script arguments...
More commits to come...
Checking in src/org/netbeans/modules/editor/NbLocalizer.java;
/cvs/editor/src/org/netbeans/modules/editor/NbLocalizer.java,v  <-- 
NbLocalizer.java
new revision: 1.7; previous revision: 1.6

Petre, thanks for reporting this issue.

Comment 3 Max Sauer 2005-07-13 16:48:43 UTC
Petre, could you please verify thsi issue? Thanks.
Comment 4 Petr Nejedly 2005-07-14 08:41:11 UTC
Yes, it is OK now.