IBM JavaTM 2 SDK HeapAnalyzer for Windows Version 1.1

 

 

Jinwoo Hwang

jinwoo@us.ibm.com

 

 

Welcome to IBM Java 2 SDK HeapAnalyzer. This tool is for internal use only.

Please do not distribute the tool externally since International Patent disclosures were submitted with this tool.

 

Introduction

The Heapdump contains a list of all the objects that are in the heap.

Heapdumps can be very large with millions of items in them.

It's not always easy to analyze a large file. This tool analyzes heapdumps of Java SDK 1.3.1 and 1.4.1.

HeapAnalyzer is an unofficial tool and is provided “as-is”.

 

Prerequisite

Java 2 SDK 1.4.1 or higher (Java 2 runtime 1.4.1  is provided with this tool)

 

Definitions

root object An object for which no (different) object holds a reference.

parent object An object (for example, A) that holds at least one reference to some

(different) object (for example, B). In this case, A is said to be the

parent of B.

Owner object If an object has more than one parent object, a parent object is chosen as owner object.

Total size is calculated only with owner objects.

child object An object (for example, B) for which at least one (different) object

(for example, A) holds a reference. In this case B is said to be the

child of A.

type Collection of same objects

size The size of an object is the amount of memory that is required to

hold that object in memory.

total size The subtree size of an object is the sum of its size and the sizes of

all the objects that it reached from its children. Note that each

object is assigned a unique parent and root during processing.

 

 

Features

 

Creates a tree from heapdump

Calculates size of each objects

Calculates total size of each subtree

Finds size drop in a subtree

Shows free heap space by size

Shows object by size

Shows types by size

Shows types by count

Shows types alphabetical order

Shows free heap space distribution

Shows detailed information of an object

Finds type with regular expression

Drag and drop support in input fields and text

                                                                        

How to run this tool

 

Java runtime environment is provided with this tool.

Usage jre\bin\java –Xmx[heapsize] –jar ha.jar

For example, jre\bin\java –Xmx1000m –jar ha.jar

If there’s java.lang.OutOfMemoryError, please try increasing the maximum heap size (-Xmx) value to give the JVM more memory.

Maximum heap size should not be larger than the size of available physical memory size for this tool due to performance issue.

Feel free to contact me if you have any comments or suggestions.

 

 

1. Start the tool.

 

[Initial screen]

 

2. Select File -> Open and select a heapdump file

 

 

 

3.  Progress is shown during processing heapdump.

 

 

 

4. It would take lots of time if you are processing large heapdump. The following is the screen when processing is complete.

Please do not close this window until you do not need this heapdump.

 

 

Click on Analysis menu and select a menu item for further analysis.

 

 

5. The following is tree view of the heapdump.

The icon, ,  indicates that it has already been included as a child object of owner object in tree view

Each tree node as in the following format:

TotalSize[Size] NumberOfChildObject Name Address

 

 

 

6. In tree view, you can see detailed information of a node , you can search for total size drop between parent and child

or you can find an address by selecting a node and click on right mouse button.

 

 

“Search for total size drop” will find a size drop between the total size of a parent

and the biggest total size of child of the parent.

If you cannot find any size drop from the menu “Search for total size drop”, you need to decrease

Minimum total size drop for search in options.

 

 

 

You can find an address in the tree view by selecting the menu “Find an address”

 

 

The following is the result of address search :

 

 

7. The following is the screen of detailed node information in heapdump tree

 

 

 

8.  The following is free heap space view

 

 

 

 

9. Object view by size

 

 

 

 

10. Type view by total size view

 

 

 

 

11. Types view by frequency

 

 

12. Free heap space distribution view

 

 

13. You can configure setting in File-> Options menu

 

 

 

14. Type by alphabetical order

 

 

15. Address by type to find types include string “byte”

 

 

The following is the list of types which have “byte” in their names.

 

 

You can also enter exact name of a type:

 

 

The following is the list of types of byte[]

 

 

16. You can monitor memory usage in “Memory Usage” menu.

 

 

 

Summary of regular-expression constructs

Construct

Matches

Characters

x

The character x

\\

The backslash character

\0n

The character with octal value 0n (0 <= n <= 7)

\0nn

The character with octal value 0nn (0 <= n <= 7)

\0mnn

The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)

\xhh

The character with hexadecimal value 0xhh

\uhhhh

The character with hexadecimal value 0xhhhh

\t

The tab character ('\u0009')

\n

The newline (line feed) character ('\u000A')

\r

The carriage-return character ('\u000D')

\f

The form-feed character ('\u000C')

\a

The alert (bell) character ('\u0007')

\e

The escape character ('\u001B')

\cx

The control character corresponding to x

 

 

Character classes

[abc]

a, b, or c (simple class)

[^abc]

Any character except a, b, or c (negation)

[a-zA-Z]

a through z or A through Z, inclusive (range)

[a-d[m-p]]

a through d, or m through p: [a-dm-p] (union)

[a-z&&[def]]

d, e, or f (intersection)

[a-z&&[^bc]]

a through z, except for b and c: [ad-z] (subtraction)

[a-z&&[^m-p]]

a through z, and not m through p: [a-lq-z](subtraction)

 

 

Predefined character classes

.

Any character (may or may not match line terminators)

\d

A digit: [0-9]

\D

A non-digit: [^0-9]

\s

A whitespace character: [ \t\n\x0B\f\r]

\S

A non-whitespace character: [^\s]

\w

A word character: [a-zA-Z_0-9]

\W

A non-word character: [^\w]

 

 

POSIX character classes (US-ASCII only)

\p{Lower}

A lower-case alphabetic character: [a-z]

\p{Upper}

An upper-case alphabetic character:[A-Z]

\p{ASCII}

All ASCII:[\x00-\x7F]

\p{Alpha}

An alphabetic character:[\p{Lower}\p{Upper}]

\p{Digit}

A decimal digit: [0-9]

\p{Alnum}

An alphanumeric character:[\p{Alpha}\p{Digit}]

\p{Punct}

Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

\p{Graph}

A visible character: [\p{Alnum}\p{Punct}]

\p{Print}

A printable character: [\p{Graph}]

\p{Blank}

A space or a tab: [ \t]

\p{Cntrl}

A control character: [\x00-\x1F\x7F]

\p{XDigit}

A hexadecimal digit: [0-9a-fA-F]

\p{Space}

A whitespace character: [ \t\n\x0B\f\r]

 

 

Classes for Unicode blocks and categories

\p{InGreek}

A character in the Greek block (simple block)

\p{Lu}

An uppercase letter (simple category)

\p{Sc}

A currency symbol

\P{InGreek}

Any character except one in the Greek block (negation)

[\p{L}&&[^\p{Lu}]] 

Any letter except an uppercase letter (subtraction)

 

 

Boundary matchers

^

The beginning of a line

$

The end of a line

\b

A word boundary

\B

A non-word boundary

\A

The beginning of the input

\G

The end of the previous match

\Z

The end of the input but for the final terminator, if any

\z

The end of the input

 

 

Greedy quantifiers

X?

X, once or not at all

X*

X, zero or more times

X+

X, one or more times

X{n}

X, exactly n times

X{n,}

X, at least n times

X{n,m}

X, at least n but not more than m times

 

 

Reluctant quantifiers

X??

X, once or not at all

X*?

X, zero or more times

X+?

X, one or more times

X{n}?

X, exactly n times

X{n,}?

X, at least n times

X{n,m}?

X, at least n but not more than m times

 

 

Possessive quantifiers

X?+

X, once or not at all

X*+

X, zero or more times

X++

X, one or more times

X{n}+

X, exactly n times

X{n,}+

X, at least n times

X{n,m}+

X, at least n but not more than m times

 

 

Logical operators

XY

X followed by Y

X|Y

Either X or Y

(X)

X, as a capturing group

 

 

Back references

\n

Whatever the nth capturing group matched

 

 

Quotation

\

Nothing, but quotes the following character

\Q

Nothing, but quotes all characters until \E

\E

Nothing, but ends quoting started by \Q

 

 

Special constructs (non-capturing)

(?:X)

X, as a non-capturing group

(?idmsux-idmsux

Nothing, but turns match flags on - off

(?idmsux-idmsux:X)  

X, as a non-capturing group with the given flags on - off

(?=X)

X, via zero-width positive lookahead

(?!X)

X, via zero-width negative lookahead

(?<=X)

X, via zero-width positive lookbehind

(?<!X)

X, via zero-width negative lookbehind

(?>X)

X, as an independent, non-capturing group

 

 

 

Copyrights and notices

(C) Copyright IBM Corporation 2004. All Rights Reserved. Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

AIX, Cloudscape, DB2, IBM, iSeries, OS/390, VisualAge, WebSphere, and z/OS are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. 

Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc. in the United States and/or other countries. 

Microsoft, Windows, and Windows NT are trademarks of Microsoft Corporation in the United States and/or other countries. 

UNIX is a registered trademark of The Open Group.

Other company, product, and service names may be trademarks or service marks of others.

The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law:

INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS TOOLS "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OR CONDITIONS OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the tool. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this tools at any time without notices.