advancedSpring Boot on Kubernetes: Health Probes, Config, Scaling & Observability
Spring Boot Pod restarts repeatedly in production with OutOfMemoryError
JVM exceeded its heap limit. Check: (1) container memory limit -- is it actually set? (2) -XX:MaxRAMPercentage or -Xmx value -- is the heap ceiling correct? (3) Heap dump/metrics -- is there a leak or sustained high allocation? With MaxRAMPercentage, also check whether non-heap (metaspace, direct buffers) is consuming unexpected memory in addition to heap.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response