Just wondering if there is a Linux command or functionality that would allow me to see what is using my Servers memory, in more details.
I know from # top shows me that Tomcat is allocating 20gb (VIRT) and using about 8gb RAM, but is there a way I can drill down further to see what Tomcat is actually using this 20gb and 8gb for?
This is a legacy application I have inherited therefore I have no idea what is going on deep down in the thousounds of lines of code in the 1500+ classes, but as soon as I start Tomcat the VIRT is at 20gb and RAM at 8gb and within a day I'm getting OutOfMemory errors.
Linux doesn't know or care what goes on inside of Tomcat or any other JVM-based application. As far as Linux is concerned, a big chunk of virtual memory has been allocated for Tomcat to use, and what Tomcat does with it is Tomcat's business.
To find out how memory is being used inside of Tomcat, you'll need to use JVM memory-management tools such as the memory profiler that comes with the JDK, the jprofile app that taps into Tomcat's MBeans and similar such diagnostic aids.
An IDE is no substitute for an Intelligent Developer.