IBM Support

Identifying the Java stack of a thread making an allocation request larger than a certain size

Technote (FAQ)


When you debug Java heap fragmentation or memory problems, it can be helpful to find the stack traces of the thread that makes large allocation requests.


Set generic JVM argument:


Starting with WebSphere Application Server version 6.1 with IBM SDK SR10 and later and WebSphere Application Server version 7 with IBM SDK 1.6 with SDK SR5 and late r, use

If you set this option to a value nnn (bytes), whenever an allocation request is made for an object size >= nnn (bytes), the Java stack trace corresponding to the thread requesting the allocation is printed into the standard error log.

There are instances when this option will not print the Java stack. It will not print Java stack when JVM considers printing of the Java stack as an unsafe operation and so the Java stack will not be printed for some threads. It is considered to be an limitation of this environment variable.

**Note: -Xdump will incur some performance overhead directly proportional to the value the filter/threshold is set.

For details on where to set the -Xdump argument:
For more information on the -Xdump argument:

To use the -Xdump option can be set to trigger a dump of the stack that makes an allocation request above or within a certain size range.

On the command line or in the generic JVM arguments set:


This will print the stack information for all allocations over 100m to the native_stderr.log

Or view an allocation within a certain range of values:


This will print the stack information for all allocations between 100m and 400m to the native_stderr.log

In the native_stderr log locate the output by searching for

"JVMDUMP006I Processing dump event "allocation""

 ./java "-Xdump:stack:events=allocation,filter=#100m" -version
JVMDUMP006I Processing dump event "allocation", detail "
126456982 bytes, class [B" - please wait.
Thread=main (088B9C4C) Status=Running
at java/lang/System.getPropertyList()[Ljava/lang/String; (Native Method)
at java/lang/System.ensureProperties()V (
at java/lang/System.<clinit>()V (
at java/lang/J9VMInternals.initializeImpl(Ljava/lang/Class;)V (Native Method)
at java/lang/J9VMInternals.initialize(Ljava/lang/Class;)V (
at java/lang/ClassLoader.initializeClassLoaders()V (
at java/lang/Thread.initialize(ZLjava/lang/ThreadGroup;Ljava/lang/Thread;)V (
at java/lang/Thread.<init>(Ljava/lang/String;Ljava/lang/Object;IZ)V (

Cross reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK

Document information

More support for: WebSphere Application Server
Java SDK

Software version: 7.0, 8.0, 8.5, 9.0

Operating system(s): AIX, Linux, Windows

Reference #: 1236523

Modified date: 19 November 2013

Translate this page: