Purpose: A weak cache is identical to the weak identity map, however the weak
can be a performance problem for some types of apps because it can cause too much garbage collection
of objects read causing them to be re-read and re-built (this defeats the purpose of the cache).
The weak cache solves this through also holding a fixed number of objects is memory to improve caching.
Responsibilities:
- Guarantees identity
- Allows garbage collection
- Increases performance through maintaining a fixed size cache of MRU objects when memory is available
- The default size of the reference cache is half the max size
|