Understanding High Memory (AnonPages) in GemFire Clusters
search cancel

Understanding High Memory (AnonPages) in GemFire Clusters

book

Article ID: 434397

calendar_today

Updated On:

Products

VMware Tanzu Data Intelligence VMware Tanzu Gemfire VMware Tanzu Greenplum VMware Tanzu Data Suite VMware Tanzu Data VMware Tanzu RabbitMQ RabbitMQ VMware Tanzu for MySQL VMware Tanzu for Postgres VMware Tanzu for Valkey

Issue/Introduction

A GemFire cluster experiences high memory utilization where the Linux meminfo report shows a large volume of AnonPages (Anonymous Pages). This often occurs on nodes running multiple GemFire servers, leading to concerns about memory leaks or misconfiguration even when JVM heap usage appears stable.

Symptoms:

  • Linux cat /proc/meminfo shows AnonPages value nearly matching the combined maximum heap (-Xmx) settings of all running JVMs.
  • The free -h command indicates "used" memory is significantly higher than the actual data stored in GemFire.
  • Memory usage does not drop significantly even after Garbage Collection (GC) cycles.

Cause

Anonymous memory (AnonPages) represents memory that is not backed by a file on disk. In a GemFire/Java environment, the entire JVM heap is accounted for as anonymous pages. If multiple servers are configured on a single node (e.g., two servers with 25GB -Xmx on a 64GB node), the OS will report approximately 50GB of AnonPages as the JVMs reserve and consume that address space

Resolution

The observed AnonPages utilization is expected behavior for JVM-based applications. To manage heap pressure and prevent system instability, follow these configuration steps:

  1. Configure Resource Manager Thresholds: Use GemFire's Resource Manager to set boundaries for heap usage. This prevents the JVM from reaching a state that causes OutOfMemoryError or system swapping.

    • eviction-heap-percentage: Set this to trigger data removal (e.g., 80%) before the heap is full.
    • critical-heap-percentage: Set this (e.g., 90%) to reject new operations when the heap is dangerously high.
  2. Optimize for ZGC (Java 17+): If using the Z Garbage Collector (ZGC), standard "tenured" metrics may not be reliable for eviction.

    • Configure SoftMaxHeapSize on the server side to give the Resource Manager a more accurate signal.
    • Set the eviction-threshold approximately 3-5% above the SoftMaxHeapSize. 
  3. Sizing Guidelines: Ensure the sum of all -Xmx settings on a node does not exceed 80-90% of physical RAM to allow for OS overhead, GemFire off-heap tracking, and stack memory