Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get size of data in Infinispan cache, alternate for calculateInMemorySize of ehcache?

I am migrating from ehcache to infinispan. In ehcache we have

net.sf.ehcache.Cache.calculateInMemorySize() 

to calculate in memory size.

How to calculate in memory size in infinispan?

like image 349
Coder Avatar asked Jun 14 '13 12:06

Coder


People also ask

How does infinispan cache work?

Infinispan replicates cache entries on a subset of nodes in a cluster and assigns entries to fixed owner nodes. Infinispan requests read operations from owner nodes to ensure it returns the correct value. Infinispan evicts stale data from all nodes whenever operations modify entries in the cache.

What is heap in Ehcache?

Data stores supported by Ehcache include: On-Heap Store - Utilizes Java's on-heap RAM memory to store cache entries. This tier utilizes the same heap memory as your Java application, all of which must be scanned by the JVM's garbage collector.

What is diskExpiryThreadIntervalSeconds?

diskExpiryThreadIntervalSeconds — Sets the number of seconds between runs of the disk expiry thread. The default value is 600. arsystem. ehcache.


1 Answers

Tomas is right, there's no currently no way to calculate size of data in memory. We do however provide users with some guidelines on the memory overhead that Infinispan incurs, which helps users plan their memory requirements. Calculating the size of data in-memory is not trivial to achieve and requires a lot of subtle details to be taken into account (type of JVM, arquitecture...etc).

like image 125
Galder Zamarreño Avatar answered Oct 10 '22 05:10

Galder Zamarreño