Why is there a difference in above numbers. In my understanding primary and backup count should be same and same as that of all the entries in cache . Also count fetched using cache.size and cache.metrics should give same numbers.
Also can someone tell me how can I get off heap memory used .
When I do itemCache.metrics().getOffHeapAllocatedSize() , I get '0' always. Is there some other metric available to fetch off heap memory metrics.
Are you sure that your cache was not accessed in the same time by another nodes/threads? Are you sure that rebalance was finished?
Could you share some simple reproducer with us?
I've tried to reproduce same behavior, but OFFHEAP, PRIMARY & BACKUP was equal to each other. Also, right after streaming of data metrics().getOffHeapPrimaryEntriesCount() was a little bit smaller than these sizes, but in a short time it became equal to them too.