gourav dhiman gourav dhiman - 2 months ago 15
Java Question

How to get the used amount of memory of heap in EHcache?

Actually i want to know the occupied memory by cache. It will give me the element count in the size not the used space. So how to get it??


The getStatistics() method of net.sf.ehcache.Cache will give the information of used memory in bytes.

StatisticsGateway stats = cache.getStatistics();