1 of 1 people found this helpful
There are a few ways that are agnostic to your configuration. You could take a heap dump at a specific time and get an estimation based on some heap analysis tools. I normally like using Eclipse MAT . You could also use JOL  to estimate the size of your objects and you can get a rough estimate from there.
If you want though Infinispan has a configuration option to enabled heap based eviction . This way your cache should never get larger than around that size. This however requires you to also store your objects as either BINARY or OFF-HEAP which both serialize the object into bytes, which are significantly easier to count
 OpenJDK: jol
william.burns, many thanks for your reply.
I'll follow the Heap Dump approach and analyse using Eclipse MAT. We're using JDG 6.x version, I suspect the "heap based" config is only available in Infinispan 9 and above, Right? I didn't know about OpenJDK JOL tool. I'll certainly take a look on it.
No problem. Hope you get everything figured out.
Yes, unfortunately the memory based eviction requires Infinispan 8 or JDG 7 and off heap requires Infinispan 9.