cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 163150 - NamingFactory uses WeakHashMap for cache instead of SoftReferences
: NamingFactory uses WeakHashMap for cache instead of SoftReferences
Status: NEW
: performance
Code
: 6.5
: PC Windows Vista
: P3 (vote)
: TBD
Assigned To:
:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-04-20 18:45 by
Modified: 2009-04-22 15:57 (History)
Issue Type: DEFECT
:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-04-20 18:45:20
netBeans demonstrates some catastrophic performance issues. In particular it
often seems to be doing lots of file 
access with no disc activity. That would appear to be because it is rapidly
doing lots of file operations on the same 
files. These accesses are supposed to be cached.

Looking into with jconsole, a likely culprit is
org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory.nameMap. 
That uses a WeakHashMap with transient Integer keys for a cache. because the
use WeakReference, entries of such a map 
can be removed immediately. Caches should use SoftReferences for keys. (Why
there aren't any sensible caches in the 
Java library, ask Josh.)