how to check heap size allocated for jvm by linux

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


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.