I am experiencing an issue at my company's application where a docker container has memory that continues to grow until an OOM error occur and the container restarts. It seems to indicate there is a memory leak in the code for that container.
It is a java application that is mainly sending/receiving/processing kafka events, we were able to reproduce this behaviour by simulating a large number of events. And it's using zookeeper to store some event data.
Things I have tried:
- using jprofiler attached to the container. (jprofiler shows container memory is stable, no indication of memory leak, memory constantly being garbage collected.
- inspecting code for that container, nothing I have noticed that would cause a memory leak.
I wonder if someone who has experience in similar setup would advice me for the possible causes of the memory issue, and where/what I should be checking as my next step.
Is it possible the memory issue is not related to the code but the docker system? I'm thinking of running that application as a standalone service and see if the same behaviour will be observed.