Details
Description
FieldDictionary helps GC by allowing fieldName:Field pairs to be purged when the GC thinks it wants to. That would be some vague low memory situation of course, and is machine, impl, and air temperature dependent.
A client of mine want them to never be purged. Other WeakRefs in the system should be purged first, or the VM should crash, but there is no situation where they want them to be eligible for purging. Now, they have cloned FieldDictionary into a subclass to effect that, but given we all love plugability, could we not have an optional constructor injected HashMapFactory ?
Well, the WeakHashMap is not there in first place to save memory, but to allow the classloader to be purged. Essential in JEE or OSGi environemnts.