I have a VPS with ubuntu 18.04.4 with 2gb and 512mb swap. Working regularly with 600-800mb and 100mb swap and all is well.
2 weeks ago I updated the WAR (tomcat) and the memory jumped to 1.2gb and 400-500mb swap. At first I thought it's normal because I did change something that should consume more memory.
I needed to restart the server (for another reason). Only then I realized that the memory got down again to 600-800mb and 300mb swap and it was like that for some time. Meaning previously, something hogged the memory and it was released with the restart.
After 2 weeks with the same consumption, I updated the WAR and again I noticed that after the re-deployment, the memory jumped to 1.2gb with 400mb swap. This time I only restarted the tomcat service and the memory consumption got down to 600mb and 100mb swap.
htop shows that Java is the one that consumes the memory but how can I know what is it exactly that is hogging the memory after undeploy/deploy that only a service restart releases it?
Thanks