There is confusion regarding what RegionMXBean.getEntrySize() reports versus operational sizing recommendations:
Explanation:
The discrepancy stems from mixing JMX metric definitions (what is physically on a member node) with cluster capacity planning guidelines (how much free space is required for stability and failover).
1. JMX Metric Measurement (getEntrySize())
As defined in the RegionMXBean API specification:
Note on getEntryCount() vs getEntrySize():
RegionMXBean.getEntryCount() reports only primary entries on the member, whereas RegionMXBean.getEntrySize() reports the combined memory footprint of both primary and secondary entries on the member.
2, Operational Capacity Planning (The 50% Heap Guideline)
Sizing best practices recommend keeping total local entry data (Primaries + Redundant Secondaries) below 50% of maximum allocated heap (-Xmx). This is not a contradiction to the JMX metric, but a necessary operational safety margin for the following reasons:
Best Practices
When reviewing JMX metrics or planning capacity:
gfsh> show metrics --member=<server-name> --region=/YourRegionName --categories=partitioned
Inspect primaryBucketCount, bucketCount, and entrySize to differentiate primary allocation from redundant allocation.