Chapter 5. Analyzing WebSphere application problems 109
Configuring the Memory Leak Diagnosis report
To set up the Diagnosis report, reconfigure the data collector to monitor the growth
classes found in 5.2.3, “Narrowing the cause of a memory leak” on page 106.
The Memory Leak Diagnosis report is set up in an XML file on the data collector in
the <am home>/etc directory. The bcm.properties file has a key/value pair called
userbcm.xmlfilename that identifies which XML configuration file is used. Adjusting
the bcm.properties files allows for multiple XML files to be swapped in and out.
The XML file is composed of multiple sections of selectClass tags that identify
how to treat classes matching the mask pattern. The XML snippet in
Example 5-1 shows the modification to monitor memory leaks.
Example 5-1 XML for monitoring memory leak
<selectClass>
<mask>*</mask>
<methods>
<methodName>*</methodName>
</methods>
<ignoreTrivial>true</ignoreTrivial>
<lockAnalysis>true</lockAnalysis>
<objectAllocations>
<allocateClass>*</allocateClass>
</objectAllocations>
<objectAllocationTimes>true</objectAllocationTimes>
</selectClass>
Only classes found inside the allocateClass tag are monitored as potential leaks.
An asterisk in the tag will monitor all classes for leaks, but a better strategy is to
use the top classes from step 2 (Figure 5-8 on page 108) for further analysis. If
step 2 does not offer any good candidates, using the asterisk to turn it on allows
for all objects to be monitored, but this has an adverse impact on performance.
Setting the objectAllocationTimes tag to true enables the Growth % and Growth
Rate columns, which can help show the rate of growth in the objects.
Note: WebSphere Studio Application Monitor generates a server-specific
bcm.properties file called <host name>.<app server name>.bcm.properties.
When changes are made to the original bcm.properties, the generated version
must be deleted so that WebSphere Studio Application Monitor knows to
regenerate the bcm.properties.
Important:
The Diagnosis report is functional only in L3 mode. It can slow down a
production system severely and should be used only in controlled test situations.