IBM内存溢出HeapAnalyzer手册.docx

上传人:PIYPING 文档编号:10719841 上传时间:2021-06-01 格式:DOCX 页数:65 大小:78.13KB
返回 下载 相关 举报
IBM内存溢出HeapAnalyzer手册.docx_第1页
第1页 / 共65页
IBM内存溢出HeapAnalyzer手册.docx_第2页
第2页 / 共65页
IBM内存溢出HeapAnalyzer手册.docx_第3页
第3页 / 共65页
IBM内存溢出HeapAnalyzer手册.docx_第4页
第4页 / 共65页
IBM内存溢出HeapAnalyzer手册.docx_第5页
第5页 / 共65页
点击查看更多>>
资源描述

《IBM内存溢出HeapAnalyzer手册.docx》由会员分享,可在线阅读,更多相关《IBM内存溢出HeapAnalyzer手册.docx(65页珍藏版)》请在三一文库上搜索。

1、IBM HeapAnalyzer IBM HeapAnalyzer Creator/Developer Jinwoo Hwang Welcome to IBM HeapAnalyzer. IBM HeapAnalyzer allows the finding of a possible Java heap leak area through its heuristic search engine and analysis of the Java heap dump in Java applications. You can find more information at http:/ In

2、troduction 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. Its not always easy to analyze a large file. This tool analyzes heapdumps of Java SDK 1.3.1,1.4.x, 5.0 and 6.0 IBM HeapAnalyzer is provided “as-is”. Supported

3、features of IBM HeapAnalyzer are ported to MDD4J which is available in IBM Support Assistant (http:/ MDD4J is an incorporation of IBM HeapAnalyzer and other IBM Java heap analysis tools. Prerequisite Java Runtime Environment 6 or higherThe following exception will be thrown if older version of Java

4、virtual machine is used:Exception in thread main java.lang.NoClassDefFoundError: java/util/regex/PatternSyntaxException 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) o

5、bject (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) obj

6、ect(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 ofall t

7、he objects that it reached from its children. Note that eachobject is assigned a unique parent and root during processing.If theres substantial difference in total size betweena parent and its child, its called a total size drop. Features Parent and Children View from Table View and Tree View Addres

8、s search Root List View Same Type View Configuration restore and save IBM, Solaris, and HP-UX Java 5.0 ascii/binary Java heap dump support IBM, Solaris, and HP-UX Java 6.0 ascii/binary Java heap dump support Look and Feel option Automatic detection of truncated heap dump Java Profile v1.0.1 ascii an

9、d binary Java heap dump support Solaris hprof 1.0.1 binary Java heap dump support heapdump file command line support. See “How to run this tool” section Supports IBM portable heap dump .phd format as well as IBM heap dump .txt and .txt.gz Automatically detects file format Supports Console window Cre

10、ates a tree from heapdump Calculates size of each objects Calculates total size of each subtree Finds total size drop in a subtree Shows gaps between objects by size Shows objects by size Shows objects by total size Shows objects by number of child Shows types by size Shows types by count/frequency

11、Shows types alphabetical order Shows gap distribution chart Shows detailed information of an object Finds type with regular expression Drag and drop support in input fields, tree and text Bookmarks in tree navigation Locates possible leak suspects How to run this tool You need to use the Java 2 Plat

12、form, Standard Edition version 6 or higher Java Runtime Environment (JRE) to run this tool. Usage java Xmxheapsize jar ha.jar For example, /usr/java60/bin/java Xmx1000m jar ha146.jar heapdump1234.txt If theres java.lang.OutOfMemoryError while you are processing heapdumps, please try increasing the m

13、aximum 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 HeapAnalyzer Initial screen 2. Selec

14、t File - Open and select a heapdump file Select IBM heap dump text file, IBM portable heap dump, Java Profile V1.0.1 ascii/binary Heap Dump or HeapAnalyzer processed file to process a heap dump. 3. Progress is shown during processing heapdump. 4. It would take lots of time if you are processing larg

15、e heapdump. The following is the screen when processing is complete. Please do not close this window until you do not need this heapdump. Memory leak suspects are compiled under “Subpoena Leak Suspect(s)” menu in Tree View. If theres no memory leak suspect, Tree View is not displayed by default. Cli

16、ck on Analysis menu and select Tree view menu item to display heap tree. 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(TotalSize/HeapSize%)Obje

17、ctSize NumberOfChildObject(Number of root objects) 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

18、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 selectin

19、g the menu “Find an address” The following is the result of address search : 7. If you want to review detailed information regarding a node, just click and you will have the information on he right pane. Or you can select the following menu. The following is the screen of detailed node information i

20、n heapdump tree 8. You can put bookmarks to save a location and continue to navigate tree by selecting “Add Bookmark”. Bookmarks are stored in “Go to Bookmark” Menu in Tree View menu bar. You can go to the saved locations in tree by clicking bookmarks Bookmarks can be deleted by clicking them in “Re

21、move Bookmark” Menu. 9. If there are lots of children in a tree, you can see “There are NNNN more children” at the bottom of the tree. You can see more children by expanding the node. You can also use “Show more children” Menu from parent nodes. Now you can see more children. 10. You can locate a po

22、ssible leak area by using “Locate a leak suspect” Menu. Suspected leak area is displayed as follows. The icon , indicates that its not a root object/class and there are parents for this node. If you want to display more parents, you can select the menu, “Show more parents” If you want to display fro

23、m root objects, you can select the menu, “Show from roots” If you want to see all the objects with the same name, select “List same type” from the menu: The following is the result of the query: By clicking on right button of your mouse, you can locate a specific object in tree view and you can find

24、 parents or children of a specific object. 11. Display objects sorted by Total Size. Objects are displayed and sorted by total size. By clicking on right button of your mouse, you can locate a specific object in tree view and you can find parents and children of a specific object. If you click on co

25、lumn header of TotalSize, the column will be sorted in reverse order. 12. List objects sorted by their sizes Objects are sorted by sizes by clicking on Size column header. 13. List objects sorted by number of child Objects are sorted by number of child by clicking on No. Child column header. Click o

26、n Address column header to sort objects in address order. Click on Object column header to sort Object in alphabetical order. You can also move each column to different locations. Address column was moved next to TotalSize column in the following screen. 14. List types sorted by size Types are sorte

27、d by sum of sizes. By clicking on right button of your mouse, you can find objects with the same name of a specific object. 15. List types sorted by frequency/count 16. List types sorted by alphabetical order Select Root List to display root objects. All root objects are displayed as follows: By cli

28、cking on right button of your mouse, you can locate a specific object in tree view and you can find same types, parents and children of a specific object. 16. List gaps between objects sorted by size The following is gaps between objects view by size 17. Display gap statistics. Gaps distribution cha

29、rt. Do not assume gaps are free spaces. Gaps are literally gaps between two objects. Java heap dumps do not have any information about what they are. 18. You can configure setting by selecting View - Options menu “Avoid Soft/WeakPhantom Reference” option creates trees that avoid Soft/Weak/Phantom Re

30、ferences as owner objects. This option requires more memory and should be enabled before you open heap dumps. 19. Search for objects/types and sort them by total size. Enter objects/types name in regular expression. Uppercase/lowercase matters! The following is the list of types which have “byte” in

31、 their names. 20. Search for objects/types and sort them by size. The following is the list of types which have “byte” in their names, sorted by number of child. By clicking on right button of your mouse, you can locate a specific object in tree view and you can find same types, parents and children

32、 of a specific object. 21. By entering exact name, we can review detailed information regarding specific types. For example, you can enter exact name of a type: byte The following is the list of types of byte as well as detailed information regarding byte The column headers have more information. Su

33、m of TotalSize is 117,712 bytes. Sum of Size is 117,712 bytes. There are 140 objects of byte You can find a specific address by selecting Search Address Enter an address of an object The following is the result of address search By clicking on right button of your mouse, you can locate a specific ob

34、ject in tree view and you can find same types, parents and children of a specific object. 22. You can hide/show status bar. 23. You can hide/show Console. Exceptions/Errors from HeapAnalyzer OutOfMemoryError Increase Xmx up to maximum available size for your environment. If you reach 32 bit address

35、space limit on 32 bit Java virtual machine, 64 bit Java virtual machine is recommended for large Java heap dumps. In most cases, about 1500MB is maximum practical size for Xmx on 32 bit Java virtual machine on Windows operating systems. For example you might want to use 64 bit Java virtual machine f

36、or a PHD Java heap dump with file size of 500MB. Exception in thread main java.lang.NoClassDefFoundError: java/util/regex/PatternSyntaxExceptionHeapAnalyzer requires Java virtual machine version 5 or higher.The exception is thrown if older versions Java virtual machine is used: java.lang.StringIndex

37、OutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(Unknown Source) at com.ibm.jinwoo.heap.FileTask$ActualTask.(FileTask.java:386) at com.ibm.jinwoo.heap.FileTask$1.construct(FileTask.java:794) at com.ibm.jinwoo.heap.SwingWorker$2.run(SwingWorker.java:45) at java.lang.Threa

38、d.run(Unknown Source) You can see this exception while processing corrupted heapdumps or truncated ones. Truncated or corrupted heapdumps are not reliable. Exception while parsing line 9 : 0x0x50003070 1000 java/lang/Stringjava.lang.RuntimeException at com.ibm.jinwoo.heap.FileTask$ActualTask.(FileTa

39、sk.java:321) at com.ibm.jinwoo.heap.FileTask$1.construct(FileTask.java:794) at com.ibm.jinwoo.heap.SwingWorker$2.run(SwingWorker.java:45) at java.lang.Thread.run(Unknown Source)Some old IBM SDKs generate invalid address in heapdumps. After replacing 0x0x with 0x, HeapAnalyzer can process heapdumps.

40、Format error while parsing line 10 : 0x50004050 0x50004050Unexpected format in heapdump. Possibly its corrupted heapdump. Further analysis is unreliable. Copyrights and notices (C) Copyright IBM Corporation 2003-2010. All Rights Reserved. Note to U.S. Government Users Restricted Rights - Use, duplic

41、ation or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. AIX, Cloudscape, DB2, IBM, iSeries, OS/390, WebSphere, and z/OS are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries. Java, Solaris and all Java-based trademarks and logos are

42、 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. Hewlett-Packard, HP and HP-UX are registered tr

43、ademarks of Hewlett-Packard Company. 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 CO

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1