A Java-based GemFire client application running in Kubernetes may exit during startup or shortly after connecting to the GemFire cluster, logging CacheClosedException and entering a CrashLoopBackOff state.
Symptoms
The pod is terminated by the Kubernetes OOM killer (OOMKill) because the container exceeds its configured memory limit.
When the GemFire client starts and connects to the cluster it performs memory-intensive operations:
If limits.memory is too low or the JVM heap (-Xmx) is configured too close to the container limit, total memory usage (Heap + Metaspace + native + thread stacks) briefly exceeds the limit. The Linux kernel OOM killer then terminates the process, often before a Java OutOfMemoryError can be logged, resulting in only final “cache is closing” messages as shutdown hooks run.
Increase Kubernetes resource limits and align JVM settings so there is sufficient headroom for both heap and native memory.
Workaround
If immediate resource changes are constrained:
Prevention / Best practices
Reference
VMware Tanzu GemFire on Kubernetes