how to check heap size allocated for jvm by linux
84,437
Solution 1
You can easily check the heap size memory allocation using JConsole, if you have a path to your jre/jdk set up correctly on the system you should be able to start it with command jconsole
from anywhere.
For managing your heap memory allocation you can have a look here: http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html
Solution 2
A simple way on Linux is to run the following:
ps -ef |grep tomcat
Look for the starting and maximum JVM memory:
-Xms1024m -Xmx4096m
In this case it is allocating 1G on startup and the Maximum is 4G.
Author by
Amit
Updated on August 24, 2021Comments
-
Amit over 2 years
I have apache-tomcat as my web server. I want to check what heap size is allocated for jvm by linux. Also from where, I can modify it.
-
Kris about 12 yearsit depends where you have your java installed, on my Fedora its '/usr/java/latest/bin', the program to call is 'jconsole', as I said if you have path to your bin directory set correctly you can just execute 'jconsole' from anywhere.
-
Amit about 12 yearsI was asking it because, I was using remote server, I am not able to run jconsole there
-
Kris about 12 yearsThen you can have a look here: stackoverflow.com/questions/7350598/…
-
Amit about 12 yearsIs there any other way to do it
-
Kris about 12 yearslook at my link above your last comment
-
Amit about 12 yearsit is not so much usable for me/ bcoz url of tomcat is not taking the jconsole
-
Kris about 12 yearscheck out this one: stackoverflow.com/questions/242958/best-tools-to-monitor-tomcat