Sunday, September 18, 2005

Understanding memory management with Caching Objects in Memory

This is a common problem. How much should we cache in memory? Will we run into Out Of Memory Errors?

I suggest you have a look at the SoftReference class in Java. It is an excellent construct that can save you this OOM headache.


  1. Implementing a SoftReference-based HashMap

  2. SoftReference, WeakReference, and WeakHashMap in Java

  3. Garbage Collection

  4. Java: Performance Tuning and Memory Management

No comments: