-
Outline
- About jhat
- What seems to be the feeling of no use
-
background
- Knowing jmap, I discovered that I left a dump file
- jhat is just to deal with this stuff ...
- Knowing jmap, I discovered that I left a dump file
-
surroundings
- THE
- win10
- Java
- 1.8.0_201
- demo
- Spring Boot
- 2.1.3
- Spring Boot
- shell
- win10 cmd
- THE
1. Prepare
-
Start a java program
- I use spring-boot webmvc of hello world
-
jps
- Find the beginning of the process pid
-
Of course the best bit jvm knowledge
- In addition to I vaguely know, jvm memory is divided into several zones, the other knew nothing ...
2. Jt
-
Outline
- About jhat
-
Jt
-
java heap dump file analysis tool
- dump file
- Jmap -dump file is obtained
- dump file
-
Working Mechanism
-
Parse dump file
- slightly
-
Turn on the server
- After completion of parsing the dump file, it will open a httpserver
- Specific results of the analysis will be presented in the form of html
-
-
3. Command
Resolving and start the service
-
command
>jhat dump.txt Reading from dump.txt... Dump file created Wed Apr 08 20:22:16 CST 2020 Snapshot read, resolving... Resolving 280375 objects... Chasing references, expect 56 dots........................................................ Eliminating duplicate references........................................................ Snapshot resolved. Started HTTP server on port 7000 Server is ready.
-
result
- 7000 port of the machine, start a webserver
-
Options
- slightly
- Actually, there are other options, but I did not understand very good, so do not say
- Interested in children's shoes can look Quguan network documentation
- slightly
4. Results
-
Outline
- Introduction of results jhat
- Really not too deep
-
example
# 单个包下, 只有一个类的一个对象 Package org.apache.catalina.security class org.apache.catalina.security.SecurityUtil [0x3c1b05858]
1. Default view: all classes
-
Outline
- The default view showing all classes heap
- It does not contain a class jvm / java language related
- This thing also need to make sure
- It does not contain a class jvm / java language related
- The default view showing all classes heap
-
classification
- Usually based on the package name, the class grouping to do ...
- Foremost, it is arrays
-
Objects
-
format
class org.apache.catalina.security.SecurityUtil [0x3c1b05858]
-
Explanation
- class org.apache.catalina.security.SecurityUtil
- org.apache.catalina.security.SecurityUtil
- Class name org.apache.catalina.security.SecurityUtil
- org.apache.catalina.security.SecurityUtil
- [0x3c1b05858]
- Object address in memory
- class org.apache.catalina.security.SecurityUtil
-
Click on the class name, you can view details
- doubt
- Some objects presented in this form
class org.apache.catalina.realm.RealmBase$AllRolesMode
- That is what happens in the end $
- Some objects presented in this form
- doubt
-
-
Other views
-
position
- Bottom of the page
-
content
- All categories
- It includes jvm / java language
- rootset all Chen Guan
- It includes jvm / java language
- Free jvm / java language
- Statistics heap memory object
- And -histo like the jmap
- Destructor statistics
- And -finalizerinfo want the jmap
- Execution OQL
- By OQL statement to find the dump file object
- I do not speak this thing
- Help pages comes
- By OQL statement to find the dump file object
- All categories
-
2. Object View: single object
- Outline
- Individual objects related content
- Look down lap, all slightly, I rub it ....
1. parent
- This simple, I will not say
2. Loader details
-
slightly
- Really Meihuahao
-
content
- Loader
- Endorser - Signers
- Protection Domains
3. subclass
-
slightly
- This also Meihuahao
-
content
- Examples of data members
- Static data members
- Examples
4. cited list
- slightly
The reference list
- slightly
6. Other queries
- Reference chain
- slightly
ps
-
ref
- Jt
- Net official documents, but very simple
- The origin of the dump file about the middle of four ways, can have a look ...
- HPROF: A Heap/CPU Profiling Tool
- Hprof of official documents
- hprof memory analysis tool is a native of
- Specifically, I might later get to know
- Hprof of official documents
- Jt
-
Follow-up
- Read a single object view
- Understanding of OQL
- Load type
- Written before a life-cycle, but to be honest I'm still a little fuzzy ...
- Memory model
- jstack
- Other visualization tools
- Learn the tools, of course, is to try to analyze specific problems