How much data is too much for on-heap cache like ehcache?
I'm getting a 24GB RAM server. I'll probably start off devoting 2-4 GB for caching but may end up devoting 20GB or so to cache. At what point should I worry that GC for on-heap cache will take too long?
By the way, is DirectMemory the only open source off-heap cache available? Is it ready for prime time?
Your cache can grow to almost any size as long as you have the RAM to handle it so 30 MB won't be a problem unless you are on a very limited device. You can specify an optional "size" limit on your MemoryCache instance, but that is optional and defaults to there being no limit.
On-heap cache is the portion of a cache that resides within the heap of the JVM where the Integration Server is running. On heap-cache is fast, but because it resides within the heap space, it is subject to the garbage collection process.
The Java Object Cache is an in-process, process-wide caching service for general application use. That is, objects are cached within the process memory space, and the Java Object Cache is a single service that is shared by all threads running in the process, in contrast to a service that runs in another process.
Geode can be configured to store region values in off-heap memory, which is memory within the JVM that is not subject to Java garbage collection.
Depends on your JVM and especially the used GC. Older GCs especially were not really capable of handling really large heaps, but there's been an increasing effort to fix that.
Azul systems for example sells hardware with hundreds of GB of heap without problems (ie gc pauses in the ms not half minutes) thanks to their special GC, so it's no limitation of Java per se. No idea how good hotspot/IBM have got over time though. But then a 24gb heap isn't that large anyhow - G1 should probably do a good enough job there anyhow.
At what point should I worry that GC for on-heap cache will take too long?
How long is too long?
Seriously, if the you are running a "throughput" garbage collector and this is giving you pauses that are too long, then you should try switching to a low-pause collector; e.g. CMS or G1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With