Finding the BW Engine thread which consumes high CPU or causes spikes in CPU usage for a particular BW engine on Linux/Windows.

Finding the BW Engine thread which consumes high CPU or causes spikes in CPU usage for a particular BW engine on Linux/Windows.

book

Article ID: KB0093773

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
You can find the thread with high CPU usage for a BW engine just like any other Java application.

Issue/Introduction

Finding the BW Engine thread which consumes high CPU or causes spikes in CPU usage for a particular BW engine on Linux/Windows.

Resolution

On a Linux platform:
=============

1). Run "top".
2). Press Shift-H to enable Threads View.
3). Get the PID (i.e., PID column) of the thread with the highest CPU usage.
4). Convert the PID (in Decimal format) to HEX  (e.g., using an online Decimal-to-HEX convertor).
5). Obtain a thread dump of the Java process that contains thread native IDs nid (e.g., using "jstack" etc.).
6). In the thread dump, look for a thread with the matching HEX PID (i.e., the 'nid=0x..' field).

On a Windows platform:
===============

1). Download and open ProcessExplorer.
2). Open the BWengine in ProcessExplorer. In the thread tab, find out the high-cpu TID.
3). Convert the TID (in Decimal format) to HEX  (e.g., using an online Decimal-to-HEX convertor).
4). Obtain a thread dump of the Java process that contains the thread native IDs nid (e.g., using "jstack" etc.).
5). In the thread dump, look for a thread with the matching HEX TID (i.e., the 'nid=0x..' field).

Additional Information

Multiple relevant resources are available in the Java community. 

http://code.nomad-labs.com/2010/11/18/identifying-which-java-thread-is-consuming-most-cpu/
http://www.pythian.com/blog/a-simple-way-to-monitor-java-in-linux/