Why there is a difference between the API call size() and the JMX clustered stats numberOfEntries when counting the entries within the JDG cache

Solution Verified - Updated -


  • The Cache API size() shows the correct number of items within the cache, but the JMX attribute jboss.datagrid-infinispan.distSyncCache.ContainerName.ClusterCacheStats.numberOfEntries shows a different number
  • It is expected that the current cache size can monitored by using JMX attribute ClusterCacheStats.numberOfEntries but it does not show the correct number of entries
  • If passivation is enabled the cache statistic provided by JMX shows incorrect numbers


  • Red Hat JBoss Data Grid (RDG; JDG)
    • 7.1
    • 7.0
    • 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In