I'm using Guava's cache in my program. I expected Guava may use a timer thread to expire its items, but I checked the source code and it seems Guava would clear its expired items only when program tries to access its items. I'm not sure if that's the way Guava's cache works.
Here's my requirement. My program works with several huge objects which loaded from files. Once a huge object get in use, the object may be accessed several times in consecutive several minutes, and then the cache would not be accessed at all in a long time. I prefer the object can be cleared as soon as possible just as expireAfterAccess(10min) or clearedAfterAccess(10min).