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.

Share:
84,437
Amit
Author by

Amit

Updated on August 24, 2021

Comments

  • Amit
    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
    Kris about 12 years
    it 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
    Amit about 12 years
    I was asking it because, I was using remote server, I am not able to run jconsole there
  • Kris
    Kris about 12 years
    Then you can have a look here: stackoverflow.com/questions/7350598/…
  • Amit
    Amit about 12 years
    Is there any other way to do it
  • Kris
    Kris about 12 years
    look at my link above your last comment
  • Amit
    Amit about 12 years
    it is not so much usable for me/ bcoz url of tomcat is not taking the jconsole
  • Kris
    Kris about 12 years