Manages manually interning Objects (like
String.intern()) except this implemenation avoids the following pitfalls
with
String.intern()
- Objects are not interned into the permgen (the permgen is independent of the normal heap and limited to 64MB by default),
so using String.intern too often can result in OutOfMemory errors when you have plently of free space
- This implemenation is faster than String.intern since it doesn't have to deal with garbage collecting weak references
Disadvantages of this implemenation include
No automatic garbage collection of Objects. Instead, you must discard the refernce to this Intern object to
allow Objects to be garbage collected
This class is thread safe.