How to find out what is the current heap size on shared hosting?

How do I find the current heap(jvm size) is assigned to my website? I am running tomcat 5.5 with Linux OS.. i have only FTP access to upload files ..

how can i find the details ? any script to identity.,
LVL 36
Loganathan NatarajanLAMP DeveloperAsked:
Who is Participating?
ysnkyConnect With a Mentor Commented:
try this;

    // Get current size of heap in bytes
    long heapSize = Runtime.getRuntime().totalMemory();
    // Get maximum size of heap in bytes. The heap cannot grow beyond this size.
    // Any attempt will result in an OutOfMemoryException.
    long heapMaxSize = Runtime.getRuntime().maxMemory();
    // Get amount of free memory within the heap in bytes. This size will increase
    // after garbage collection and decrease as new objects are created.
    long heapFreeSize = Runtime.getRuntime().freeMemory();
Loganathan NatarajanLAMP DeveloperAuthor Commented:
thanks, it works
All Courses

From novice to tech pro — start learning today.