Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

An Introduction to WebSphere Application Server Performance Tuning Toolkit

Part2: Analyzing Problem Scenarios

Shishir Narain (, IT Architect, IBM
Shishir Narain photo
Shishir Narain is Open Group certified Master IT Specialist with mature skills in IBM middleware products. He works in IBM Lab Services for WebSphere at India Software Labs, Gurgaon. He has 12 years of experience developing solutions for multiple clients. He has a Master of Technology degree from Indian Institute of Technology, Kanpur.
(An IBM developerWorks Contributing Author)
Tao Zhang (, Software Engineer, IBM
author photo
Zhang Tao (Jordan) joined IBM in 2009. He works in IBM China Software Development Lab WebSphere Application Server SVT team in Beijing. He is interested in WebSphere Migration, Intelligent Management, and high availability.
Wang Yu (, Software Engineer, IBM
author photo
Wang Yu (Edward) is a software engineer at the IBM China Software Development Lab in Beijing. He is a member of WebSphere Application Server SVT team. He is also interested in WebSphere Application Server performance analysis, performance tuning, problem diagnosis, and high availability.

Summary:  WebSphere® Application Server is a key component of enterprise architecture, and performance bottlenecks can affect multiple applications. This tutorial series introduces WebSphere Application Server Performance Tuning Toolkit, which can be used for uncovering performance bottlenecks and tuning the WebSphere Application Server infrastructure. This part presents several more problem scenarios and shows how PTT can help in detecting and resolving the issues.

Date:  24 Oct 2012
Level:  Intermediate PDF:  A4 and Letter (1646 KB | 21 pages)Get Adobe® Reader®

Activity:  9957 views

Memory leak problems

Memory leaks occur when a program does not free a reference to an object even though the object is not used later, thus making the object's memory unclaimable through garbage collection.

Triggering the problem

Listing 4 shows the required code changes in the TradeAppServlet to trigger the memory leak problem

Listing 4: Code for causing a memory leak
//For Memory Leak
public static ArrayList leakContainer = new ArrayList();
if (TradeConfig.isMemeoryLeak()){
    		leakContainer.add(new byte[TradeConfig.getLeakSize()]);

In the Server tab of Daytrader home page (see Figure 16), select the Memory Leak check box and click Update Configuration. The application leaks heap memory at the specified rate.

Figure 16: Specifying a memory leak on the DayTrader configuration screen
DayTrader                         configuration screen

Monitoring and Investigating the problem

When a connection leak problem occurs, you can see Used Heap alerts in the dashboard. (Figure 17).

Figure 17: PTT dashboard showing used heap alerts
dashboard                         showing alerts

Next, generate a heap dump, as shown in Figure 18.

Figure 18: Generating a heap dump
menus for                         generating a heap dump

The heap dump file is generated under the profile folder of the server. This file can be analyzed using the Memory Analyzer tool in ISA. Import the dump file in ISA and use Memory Analyzer on the dump file. See Figure 19.

Figure 19: Performing memory analysis on a dump file
menus for                         specifying memory analysis

Choose the default options in the Memory Analyzer tools (Figure 20).

Figure 20: Memory Analyzer options
screen                         for selecting memory analyzer options

Memory Analyzer takes several minutes to analyze the dump file. After the analysis is complete, you can open the analysis file. The format of the file name is heapdump.*_analyzer.html. See Figure 21.

Figure 21: Memory analysis report
screen                         for choosing memory analysis report

Select the leak suspects report. This report show information about the leaks. See Figure 22.

Figure 22: Memory analysis details: leak suspects
pie chart                         showing leak suspects

Click Details to get more information about the problem (Figure 23).

Figure 23: Memory Analysis details of suspected leaks

From the above analysis it is evident that the memory issue is caused by ArrayList objects in TradeAppServlet.

5 of 8 | Previous | Next


TutorialTitle=An Introduction to WebSphere Application Server Performance Tuning Toolkit