28 September 2009
|
Memory-sensitive HashMap Cache for Java
|
|
A while ago I implemented a soft reference cache for Java, which allows for a memory-sensitive HashMap-style cache of objects tied to particular keys. Thanks to the SoftReference Java API, the contents of the cache are guaranteed to be removed before an OutOfMemoryError is thrown.
You can see a real-world implementation of caching the loading of XML documents as part of the IAML project. It can be downloaded directly from the IAML website, or installed as part of EmfTools. Music: Nine Inch Nails – The Way Out Is Through
|