Local database reading edition
Monitoring heap space while executing web App?
Reconstructed from database records, not a captured original forum layout. Dates and display names are retained as recorded; timezone and real-world identity are not inferred. Historical advice, contact details and offers are not current. Original markup is shown as inert text.
Forum index · Java - Tips Of The Day
Opening post
Asha · 2001-02-14 16:34:27
As we know, the JVM's heap stores objects created by executing Java program. However, there is no easy way to dynamically monitor the amount of free space available on the heap or the total memory currently being consumed by application objects within your web applications. You can get some idea of this within the executing servlets/JSPs themselves by making use of Runtime.freeMemory() and Runtime.totalMemory(), but usually this is skewed due to the dynamic nature of these entities.
However, many application servers provide mechanisms to monitor the heap in real time. For example, with Weblogic, you can use the console to not only find out the size of the current heap, but also view a dynamically updated graph which shows you the % amount of heap used at that point in time. Thus, if you find the server gradually running short of heap space (due to increased activity, a memory leak), you should be able to command the server to trigger a garbage collection event from the console itself.
Asha Balasubramanyan
http://www.ammu.org
Source notes
MyCommunity/nandighosha.org.zip!/forum/tools/snitz_forums_2000.mdb
Table: FORUM_TOPICS + FORUM_REPLY · record IDs: 33