JVM OOM in Kubernetes POD with small memory allocated

<p>How to configure JVM memory on POD with a small memory resource.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:700/0*tipgcjaKux0rHdp3" style="height:467px; width:700px" /></p> <p>Photo by&nbsp;<a href="https://unsplash.com/@pawel_czerwinski?utm_source=medium&amp;utm_medium=referral" rel="noopener ugc nofollow" target="_blank">Pawel Czerwinski</a>&nbsp;on&nbsp;<a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral" rel="noopener ugc nofollow" target="_blank">Unsplash</a></p> <h1>Problem</h1> <p>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.</p> <h1>Tools</h1> <p>The first thing is we need to understand the application&rsquo;s current memory usage. We can use a range of tools to track the memory and heap usage. Refer to&nbsp;<a href="https://www.baeldung.com/java-heap-dump-capture" rel="noopener ugc nofollow" target="_blank">https://www.baeldung.com/java-heap-dump-capture</a>. However, there are some restrictions.</p> <p><a href="https://medium.com/javarevisited/jvm-oom-in-kubernetes-pod-with-small-memory-allocated-64eab77e6223"><strong>Website</strong></a></p>
Tags: Small Memory