Bug 54143 - Add display of PermGen memory pool usage to the Status page of the Manager webapp
Summary: Add display of PermGen memory pool usage to the Status page of the Manager we...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Manager (show other bugs)
Version: 7.0.32
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-13 22:39 UTC by Konstantin Kolinko
Modified: 2014-12-06 20:07 UTC (History)
0 users



Attachments
2014-12-02_tc6_54143_v1.patch (10.09 KB, patch)
2014-12-02 15:14 UTC, Konstantin Kolinko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2012-11-13 22:39:44 UTC
It would be nice to add display of the PermGen memory pool usage to the Status page of the Manager webapp.

This is because OutOfMemoryError's caused by PermGen pool exhaustion are fatal for the server and are hard to predict, as they are are not visible from the simple Free/Max/Total Heap statistics.

Technically speaking, the information is provided by "MemoryPool" MBeans. It is easier to display all memory pools at once rather than to search for specific one.

The beans could be obtained via a query, e.g. [1], but it is much easier to use standard API that is available in Java SE [2].

[1] http://localhost:8080/manager/jmxproxy/?qry=java.lang%3Atype%3DMemoryPool%2C*
[2] http://docs.oracle.com/javase/6/docs/api/java/lang/management/MemoryPoolMXBean.html

I have an implementation ready and will commit it shortly.

A small question is whether it is suitable for the simple "Server Status" page or is better for the "Complete Server Status" one. I think it is OK on the simple page, as this information is important.
Comment 1 Konstantin Kolinko 2012-11-13 22:59:01 UTC
Implemented by r1409014 and will be in 7.0.33.
Comment 2 Konstantin Kolinko 2014-12-02 15:14:27 UTC
Created attachment 32252 [details]
2014-12-02_tc6_54143_v1.patch

Patch for Tomcat 6
Add display of memory pools. Update and fix XSL style and schema.

Backport of r1409014, r1453106, r1453119, r1348992 from tomcat/tc7.0.x/trunk.

      <add>
        <bug>54143</bug>: Add display of the memory pools usage (including
        PermGen) to the Status page of the Manager web application. (kkolinko)
      </add>
      <fix>
        Fix several issues with <code>status.xsd</code> schema in Manager web
        application, testing it against actual output of StatusTransformer
        class. (kkolinko)
      </fix>

To test the schema, one can save output of /manager/status?XML=true command and add the following attributes to the root <status> element:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="status.xsd"
Comment 3 Konstantin Kolinko 2014-12-06 20:07:08 UTC
Applied to Tomcat 6 in r1643600 and will be in 6.0.44 onwards.