Java - JVM - jhat brief description

  1. Outline

    1. About jhat
    2. What seems to be the feeling of no use
  2. background

    1. Knowing jmap, I discovered that I left a dump file
      1. jhat is just to deal with this stuff ...
  3. surroundings

    1. THE
      1. win10
    2. Java
      1. 1.8.0_201
    3. demo
      1. Spring Boot
        1. 2.1.3
    4. shell
      1. win10 cmd

1. Prepare

  1. Start a java program

    1. I use spring-boot webmvc of hello world
  2. jps

    1. Find the beginning of the process pid
  3. Of course the best bit jvm knowledge

    1. In addition to I vaguely know, jvm memory is divided into several zones, the other knew nothing ...

2. Jt

  1. Outline

    1. About jhat
  2. Jt

    1. java heap dump file analysis tool

      1. dump file
        1. Jmap -dump file is obtained
    2. Working Mechanism

      1. Parse dump file

        1. slightly
      2. Turn on the server

        1. After completion of parsing the dump file, it will open a httpserver
        2. Specific results of the analysis will be presented in the form of html

3. Command

Resolving and start the service

  1. 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.
    
  2. result

    1. 7000 port of the machine, start a webserver
  3. Options

    1. slightly
      1. Actually, there are other options, but I did not understand very good, so do not say
      2. Interested in children's shoes can look Quguan network documentation

4. Results

  1. Outline

    1. Introduction of results jhat
    2. Really not too deep
  2. example

    # 单个包下, 只有一个类的一个对象
    Package org.apache.catalina.security
    class org.apache.catalina.security.SecurityUtil [0x3c1b05858]
    

1. Default view: all classes

  1. Outline

    1. The default view showing all classes heap
      1. It does not contain a class jvm / java language related
        1. This thing also need to make sure
  2. classification

    1. Usually based on the package name, the class grouping to do ...
    2. Foremost, it is arrays
  3. Objects

    1. format

      class org.apache.catalina.security.SecurityUtil [0x3c1b05858]
      
    2. Explanation

      1. class org.apache.catalina.security.SecurityUtil
        1. org.apache.catalina.security.SecurityUtil
          1. Class name org.apache.catalina.security.SecurityUtil
      2. [0x3c1b05858]
        1. Object address in memory
    3. Click on the class name, you can view details

      1. doubt
        1. Some objects presented in this form class org.apache.catalina.realm.RealmBase$AllRolesMode
          1. That is what happens in the end $
  4. Other views

    1. position

      1. Bottom of the page
    2. content

      1. All categories
        1. It includes jvm / java language
      2. rootset all Chen Guan
        1. It includes jvm / java language
        2. Free jvm / java language
      3. Statistics heap memory object
        1. And -histo like the jmap
      4. Destructor statistics
        1. And -finalizerinfo want the jmap
      5. Execution OQL
        1. By OQL statement to find the dump file object
          1. I do not speak this thing
          2. Help pages comes

2. Object View: single object

  1. Outline
    1. Individual objects related content
    2. Look down lap, all slightly, I rub it ....

1. parent

  1. This simple, I will not say

2. Loader details

  1. slightly

    1. Really Meihuahao
  2. content

    1. Loader
    2. Endorser - Signers
    3. Protection Domains

3. subclass

  1. slightly

    1. This also Meihuahao
  2. content

    1. Examples of data members
    2. Static data members
    3. Examples

4. cited list

  1. slightly

The reference list

  1. slightly

6. Other queries

  1. Reference chain
    1. slightly

ps

  1. ref

    1. Jt
      1. Net official documents, but very simple
      2. The origin of the dump file about the middle of four ways, can have a look ...
    2. HPROF: A Heap/CPU Profiling Tool
      1. Hprof of official documents
        1. hprof memory analysis tool is a native of
        2. Specifically, I might later get to know
  2. Follow-up

    1. Read a single object view
    2. Understanding of OQL
    3. Load type
      1. Written before a life-cycle, but to be honest I'm still a little fuzzy ...
    4. Memory model
    5. jstack
    6. Other visualization tools
    7. Learn the tools, of course, is to try to analyze specific problems

Guess you like

Origin www.cnblogs.com/xy14/p/12663028.html