Search code examples
javamemory-managementheap-dump

Analysis on Memory Management


I'm doing Memory management analysis for my Java web application,

Before starting my tomcat the free memory in RAM was around 595 MB, Once I started the server the free memory goes to 151 MB. When I took the Heap dump, the objects were occupying 262 MB.

So will tomcat alone take remaining 181 MB?

Another question is, I ran Load Test with 500 Users. The free memory goes to 8MB, When I took heap dump here, It was around 265MB. So free space 151 MB is reduced to 8MB, What could be reason

Please note that I used top command to check free memory in RAM.


Solution

  • The free memory is the memory not used by the kernel, programs or disk cache. How big the disk cache is varies based on which files you have accessed or deleted and is a poor indication of memory consumption.

    Java uses quite a bit of memory starting up. Much of it is shared. Tomcat can be a relatively complex application depending on what you load, but to use 181 MB for the JVM and Tomcat seems reasonable to me.