how to check heap size allocated for jvm by linux
Asked Answered
P

4

10

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.

Poltroonery answered 13/2, 2012 at 8:18 Comment(0)
K
6

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

Kingfisher answered 13/2, 2012 at 8:25 Comment(7)
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.Kingfisher
I was asking it because, I was using remote server, I am not able to run jconsole therePoltroonery
Then you can have a look here: #7351098Kingfisher
Is there any other way to do itPoltroonery
look at my link above your last commentKingfisher
it is not so much usable for me/ bcoz url of tomcat is not taking the jconsolePoltroonery
check out this one: stackoverflow.com/questions/242958/best-tools-to-monitor-tomcatKingfisher
Y
31

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.

Yost answered 23/4, 2014 at 19:16 Comment(0)
K
6

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

Kingfisher answered 13/2, 2012 at 8:25 Comment(7)
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.Kingfisher
I was asking it because, I was using remote server, I am not able to run jconsole therePoltroonery
Then you can have a look here: #7351098Kingfisher
Is there any other way to do itPoltroonery
look at my link above your last commentKingfisher
it is not so much usable for me/ bcoz url of tomcat is not taking the jconsolePoltroonery
check out this one: stackoverflow.com/questions/242958/best-tools-to-monitor-tomcatKingfisher
A
0

The heap size used by Tomcat is defined in its configuration.

This is the place where you can both check and change it.

If you're unsure about where this configuration is saved, I'd suggest looking at the Tomcat documentation where this is explained together with all configuration values.

Archaeornis answered 21/2, 2012 at 17:47 Comment(0)
N
0

If you need more information from the server but cannot log into it interactively (or don't have a GUI or JMX set up etc) you can include javamelody in your POM file/libs and it will create a page at host:8080//monitoring with all kinds of good information, including heap size, GC statistics and permgen size.

This is NOT a safe thing to leave running in a production environment - if you need it all the time at least lock it down!

Noria answered 28/3, 2016 at 12:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.