How to configure JVM memory on POD with a small memory resource.
Photo by Pawel Czerwinski on Unsplash
Problem
A Kubernetes POD is configured with max 1000 MB memory and 1 CPU. Recently high memory usage has been observed(90%+) and results in POD being killed by OOM. In this article, I will explain how I solve this issue.
Tools
The first thing is we need to understand the application’s current memory usage. We can use a range of tools to track the memory and heap usage. Refer to https://www.baeldung.com/java-heap-dump-capture. However, there are some restrictions.