Is there a way to configure the maximum eden space size in caffeine cache? If not, what is the default size? https://github.com/ben-manes/caffeine/blob/master/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/WindowTinyLfuPolicy.java
-
What does this have to do with Guava? – Andy Turner Jan 12 '16 at 11:29
-
@AndyTurner, sorry, I couldn't find a tag for the "caffeine" library. – Jin H. Wan Jan 12 '16 at 21:21
-
@AndyTurner I think the confusion is my prior involvement with Guava and Caffeine's similarities. Kevin has said he favors transitioning Google over to Caffeine after the JDK8 release, but I think how the relationship will evolve is still an unknown. – Ben Manes Jan 13 '16 at 07:41
2 Answers
The term eden
was borrowed from JVM generational garbage collectors, where most objects die young and are not promoted. We later decided on window
when coming up with a name for the eviction policy (Window TinyLFU
).
In the simulator you can adjust the window size by modifying the percent-main
in the configuration file. That makes it easy to experiment with different trace files when evaluating policies and the impact of tuning options.
For the production facing cache, the window size is not a configuration parameter. This value is hard coded to 1%, which was near optimal across a variety of workloads and avoids TinyLFU's degredation scenarios. In some workloads (OLTP disk traces) a larger value has a small gain, but not enough to expose a configuration option. Doing so wouldn't carry its conceptual weight by confusing most users and leak implementation details.

- 9,178
- 3
- 35
- 39
-
-
@andrsncpr I work right by the Caltrain station near Amplitude, so feel free to email me if you play around and want to grab lunch to discuss. – Ben Manes Jan 12 '16 at 21:38
you can add eden space declaration at the start of JVM using the parameters:
-XX:NewSize=size
-XX:MaxNewSize=size
Ideally Eden space = 3/8 total heap size.

- 1,634
- 13
- 26