intermediateJVM & GC403 of 436

How can unbounded caches cause memory problems?

Tests whether you know a cache with no eviction policy or size bound is functionally a memory leak -- every entry stays reachable forever -- and that the fix is a bounded cache with an eviction strategy (LRU, TTL, or a weak-reference-based cache).

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

← Back to all Core Java questions