Keeping Your Cache Down to Size

Guava’s CacheBuilder provides several options for keeping a cache down to a reasonable size. Entries can expire for multiple reasons, entries can be limited to a certain number, and entries can be made available for garbage collection. These options can be used individually or together. Each is simply one more method call during cache creation. … Read moreKeeping Your Cache Down to Size

Goodbye, MapMaker. Hello, CacheBuilder.

Google has released a new version of Guava, and it’s bad news for one of my favorite classes, MapMaker. The exciting feature of MapMaker is its ability to produce an insta-cache, a key-value mapping that calculates values on the fly, expires them, and limits the quantity stored — all while maintaining thread safety. In release … Read moreGoodbye, MapMaker. Hello, CacheBuilder.