Posible Memory Leak Spring Boot App File Watcher thread

75 views Asked by At

Hello I have an OOM issue in my Java application. It's deployed in a Kubernetes container, and it's an API that uses the Spring Boot microservice architecture and works with files. Initially, I don't see any critical code failure that leads me to suspect that the memory leak is due to this. Therefore, I have decided to use VisualVM to monitor my application's memory and identify which threads are consuming the most resources. I have conducted several tests and left the application running for several hours while performing other tasks (typically, the OOM occurs every day, causing Kubernetes to restart the application). All of them make me suspect that the File Watcher thread is responsible for the memory leak. Initially, it allocates very few Bytes in memory, but over time, it keeps increasing. Additionally, when I used the Eclipse Memory Analyzer, this thread was identified as one of the leak suspects. I am attaching VisualVM and Memory Analyzer screenshots, along with the Java VM parameters I am using. Thank you very much.

VISUAL VM MONITORING

Wave pattern i read is normal -> here

FILE WATCHER THREAD

The Bytes only go up

MEMORY LEAK SUSPECTS

Subspects Header

Thread Details

PARAMTERS VM

The parameters Im using for JVM

0

There are 0 answers