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 46629

Summary: o.n.mdr.handlers.gen.HandlerGenerator wasting memory
Product: java Reporter: _ rkubacki <rkubacki>
Component: UnsupportedAssignee: Martin Matula <mmatula>
Status: RESOLVED FIXED    
Severity: blocker CC: issues
Priority: P3 Keywords: PERFORMANCE
Version: 4.x   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ rkubacki 2004-07-27 18:43:08 UTC
o.n.mdr.handlers.gen.HandlerGenerator.customImplInfos
is a HashTable<Class,HashSet<String>> object
containing signatures for generated handlers. It
occupies 420kB on heap and it is never GC'ed. 

I do not know why we need this table but if we
really use it should be more memory friendly. At
least there is a lot of repeated method signatures
where we can share strings. Maybe we can
reconsider the whole heavy use of reflection.
Comment 1 Martin Matula 2004-07-28 13:05:41 UTC
Fixed. customImplInfos has been transfored into a LRU cache of a
limited size (5) rather than a static hashmap that is never collected.

Checking in src/org/netbeans/mdr/handlers/gen/HandlerGenerator.java;
/cvs/mdr/src/org/netbeans/mdr/handlers/gen/HandlerGenerator.java,v 
<--  HandlerGenerator.java
new revision: 1.13; previous revision: 1.12
done