JRockit Flight Recorder ハンズオン ??を及ぼしているような状況です。 Flight Recorder を利用することでこの手の 問題を調査しやすくなります。 今回のハンズオンキットにはよくあるテレビの料理番組のように、すでに記録済 みのレコーディングファイルが提供されてい ...

  • Published on
    10-May-2018

  • View
    213

  • Download
    1

Transcript

  • 1 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    JRockit Flight Recorder

    Fusion Middleware

    Application Grid

    2011 11 10

  • 2 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

  • 3 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Oracle JRockit Flight Recorder

    Introduction ........................................................................................................... 4 Starting JRockit Mission Control ........................................................................... 4

    1.a Starting the Stand Alone Version of JRMC ...................................... 5

    1.b Starting JRMC in Eclipse .................................................................. 6 JRockit Flight Recorder ......................................................................................... 7

    2.a Starting a JFR Recording ................................................................. 7

    2.b Hot Methods ..................................................................................... 9

    3 Latencies ........................................................................................... 10

    4 Garbage Collection ................................................. 13

    5 WebLogic Server Integration ...................................................... 13

    6 Exceptions ................................................................................. 15 JRockit Memory Leak Detector ........................................................................... 17

    7 Finding a Memory Leak ..................................................................... 17

    8 On Line Leak Hunting ............................................................... 19

    Management Console () ....................................................................... 21

    9.a The Overview ................................................................................. 21

    7.b The MBean Browser....................................................................... 22

    7.c The Threads View .......................................................................... 23

    7.d Triggers .................................................................................. 25

    JRCMD (JRockit CoMmanD) () ............................................................ 25

  • 4 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Introduction Oracle JRockit Mission Control Java

    JRockit JVM JRockit

    HotSpot JVM JRockit Mission Control HotSpot

    JVM

    Mission Control

    Management Console JVM

    JMX

    Flight Recorder

    Memory Leak Detector Java

    JRockit Flight Recorder

    JRockit Memory Leak Detector JRockit Management Console

    JRockit Mission Control

    Eclipse

    /home/oracle/4.0_labs

    4.0_labs

    cd 4.0_labs ./startJRMC.sh

    GUI Eclipse

    |

    File | Open File

    File | Open File

    Starting JRockit Mission Control JRockit Mission Control

    JRockit Mission Control

    Eclipse

    Eclipse JRockit Mission

    Control

  • 5 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    1.a Starting the Stand Alone Version of JRMC

    /home/oracle/4.0_labs startJRMC.sh

    JRockit Mission Control JVM

    JVM JRockit Discovery

    Protocol (JDP) JVM

    JVM

    JRockit JVM JVM

    JVM

  • 6 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    JRockit Mission Control Management

    Console JVM JVM

    Management Console JVM

    Management Console

    JVM Mission Control JVM This

    Mission Control

    JRockit Mission Control Eclipse

    JRockit Mission Control

    JRockit Mission Control

    | Exit

    1.b Starting JRMC in Eclipse

    startEclipse.sh Eclipse

    workspace JVM Eclipse

    Java perspective perspective

    Java perspective

    Mission

    Control perspective Eclipse JRockit Mission

    Control

  • 7 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Eclipse (JRockit Mission Control) JVM

    This Eclipse

    JRockit Flight Recorder JRockit Flight Recorder(JFR) JRockit Mission Control

    JVM JRockit

    JRockit JRockit

    2.a Starting a JFR Recording

    HotMethods

    Java perspective | | HotMethods

    HotMethods Mission Control perspective

    JVM HotMethods JVM

  • 8 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    HotMethods

    2 min

    OK

    x%

  • 9 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    2

    2.b Hot Methods

    | Hot Methods()

    2.a

    Java

    perspective 2_JFR_HotMehods hotmethods.jfr

    Mission Control perspective

    1.

    2.

  • 10 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    3.

    HotMethods

    Java perspective | | Terminate

    1.

    (10 )

    Readme.txt Tips Eclipse

    JRockit JVM

    3 Latencies

    CPU

    Flight Recorder

    Eclipse Java perspective

    3_JFR_Latencies/latency.jfr

    Mission Control perspective | Graph

  • 11 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    main main

    +

    1.

    2.

    3.

    | Trace

    Java

    Blocked CPU/ | Contention

    | TraceTrace Tree

    : :

    Java

  • 12 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Logger

    Logger

    WorkerThread.run()

    Fix

    Logger.log(String) 3_JFR_Latencies log synchronized

    Logger Logger

    synchronization

    Logger

    Logger

    .

    less_latency.jfr Logger.log(String)

    synchronized

    latency.jfr

    Eclipse jfr

    | Graph less_latency.jfr latency.jfr

    CPU/ | Overview CPU

    3 latency.jfr less_lettency.jfr

  • 13 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    4 Garbage Collection

    Garbage Collection

    4_JFR_GC allocator.jfr Mission Control

    perspective Eclipse allocator.jfr

    allocator.jfr

    | GC GraphGC

    GC JRockit GC

    GC GC

    | GC GENERALGC GC REQUEST TRACE TREE

    GC GC

    | Allocation

    Allocation Pressure

    :

    1. MyAlloc

    GC

    Autoboxing

    JVM GC

    5 WebLogic Server Integration JRockit Mission Control

    WebLogic

    WebLogic Diagnostics Framework(WLDF) Dynamic Monitoring

    System(DMS)

    5_JFR_WLS medrec.jfr

  • 14 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    WebLogic

    1.

    WebLogic | Servlets

    /patient/login.do

    WebLogic | Servlets /patient/login.do

    Operative Set | Add Selection

    Operative Set

    | Log

    WebLogic Server

    Show Only Operative Set

    2.

    3.

    Operative Set

  • 15 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    | Add matching ECID ECID

    ID

    4. SQL

    5. EJB SQL

    6.

    | Log | Event Log JDBC Statement Execute

    SQL Event Attributes

    Event Thread

    | Graph Show Only Operative Set

    6 Exceptions catch

  • 16 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    JVM

    JFR

    6_JFR_Exceptions exceptions.jfr | Exceptions

    ScaryException

    ScaryException Operative Set | ScaryException Flight Recorder | Show Only Operative Set

  • 17 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    JRockit Memory Leak Detector JRockit Memory Leak Detector

    7 Finding a Memory Leak

    Eclipse Java perspective | Leak

    Mission Control perspective JVM

    Leak Start MemleakMemleak

    Growth Rate Add to Type

    GraphType Graph

    HashTable

    Java.util.Hashtable$Entry Leak$DemoObject

    List referring instances

    Add to Instance Graph

    Memleak

    java.util.Hashtable$Entry

    Expand to RootHashTable

    Leak

    DemoThreadtable

  • 18 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Trend Leak$DemoObject

    Trace Allocations

    remove put

    put

    1.

    2. fix

  • 19 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    7 Java perspective | | Terminate

    Leak

    8 On Line Leak Hunting

    JRockit Memory Leak Detector

    Eclipse

    | type filter text

    TrendLowest heap usage to report

    0

    Eclipse AddressBook

    MemoryLeaker

    Mission Control perspective JVM

    AddressBook Start MemleakMemleak

    JRockit Memory Leak detector TrendFilter

    ColumnAddress Address

  • 20 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Trend AddressBook

    add remove

    Readme.txt

    1.

    2. JRockit Memory Leak Detector

    AddressBook

  • 21 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Management Console () JRockit Management Console JMX JVM

    9.a The Overview

    JRockit Mission Control startJRMC.sh

    LoadAndDeadlock

    loadAndDeadlock.sh

    LoadAndDeadlock JVM

    Management Console

    Th

  • 22 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    ThreadCount

    ThreadCount 20

    1. 20

    ThreadCount

    2. Live Set

    ThreadCount

    7.b The MBean Browser

    MBean MBean MBean

    MBean

    MBean

    MBean MBean

    GC

    oracle.jrockit.management GarbageCollector Strategy

    java.langThreading

    ThreadCount

    MBean

  • 23 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    1. DiagnosticCommand print_threads

    MBean oracle.jrockit.management DiagnosticCommand String

    execute

    print_threads

    2.

    print_threads

    7.c The Threads View

    JRMC |

    ThreadCount

  • 24 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    1. JRockit Mission Control Eclipse

  • 25 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    7.d Triggers

    CPU

    CPU 50%

    JRMC MBeans |

    oracle.jrockit.management.Runtime/CPULoad

    Next 0.5 Next

    Next

    Next

    Finish

    |

    JRCMD (JRockit Command) ()

    JRockit jrcmd

    JROCKIT_HOME/bin

    . ./setenv.sh

    jrcmd

  • 26 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Java Eclipse

    JRockit Mission Control

    jrcmd Java

    ID JRCMD Java

    jrcmd PID JVM jrcmd help

    0

    JRockit

    JRockit

    1. Eclipse Leak

    jrcmd print_object_summary

    Leak PID

    print_object_summary

  • 27 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    Tips JRockit JVM JRockit Mission Control java Xmanagement:autodiscovery=true,authenticate=false,ssl=false port=7901 MyAPP JVM JVM JVM jrcmd start_management_server authenticate=false ssl=false port=7901

    2. JFR JRCMD

    start_flightrecording

  • 28 / 28

    Copyright(c) 2011, Oracle. All rights reserved.

    3. Eclipse ExceptionThrower

    Debug perspective

    ExceptionApplication

    jrcmd

    ExceptionApplication PID jrcmd verbosity

    set=exceptions=info Eclipse

    4. jrcmd verbosity set=exceptions=debug

    jrcmd verbosity set=exceptions=quiet

    JRockit

    : : 7.b DiagnosticCommands JRCMD jrcmd DiagnosticCommand MBean

Recommended

View more >