Skip to content

필사 모드: Analyzing Java Processes with Async Profiler

English
0%
정확도 0%
💡 왼쪽 원문을 읽으면서 오른쪽에 따라 써보세요. Tab 키로 힌트를 받을 수 있습니다.
원문 렌더가 준비되기 전까지 텍스트 가이드로 표시합니다.

Background

I would like to introduce [Async Profiler](https://github.com/async-profiler/async-profiler), a software that helps investigate which functions and calls are being made at runtime with minimal impact on the Java application.

Install

wget https://github.com/jvm-profiling-tools/async-profiler/releases/download/v2.9/async-profiler-2.9-linux-x64.tar.gz

tar -zxvf async-profiler-2.9-linux-x64.tar.gz

Execute

$./profiler.sh

Usage: ./profiler.sh [action] [options] <pid>

Actions:

start start profiling and return immediately

resume resume profiling without resetting collected data

stop stop profiling

dump dump collected data without stopping profiling session

check check if the specified profiling event is available

status print profiling status

meminfo print profiler memory stats

list list profiling events supported by the target JVM

collect collect profile for the specified period of time

and then stop (default action)

Options:

-e event profiling event: cpu|alloc|lock|cache-misses etc.

-d duration run profiling for <duration> seconds

-f filename dump output to <filename>

-i interval sampling interval in nanoseconds

-j jstackdepth maximum Java stack depth

-t profile different threads separately

-s simple class names instead of FQN

-g print method signatures

-a annotate Java methods

-l prepend library names

-o fmt output format: flat|traces|collapsed|flamegraph|tree|jfr

-I include output only stack traces containing the specified pattern

-X exclude exclude stack traces with the specified pattern

-v, --version display version string

--title string FlameGraph title

--minwidth pct skip frames smaller than pct%

--reverse generate stack-reversed FlameGraph / Call tree

--loop time run profiler in a loop

--alloc bytes allocation profiling interval in bytes

--live build allocation profile from live objects only

--lock duration lock profiling threshold in nanoseconds

--total accumulate the total value (time, bytes, etc.)

--all-user only include user-mode events

--sched group threads by scheduling policy

--cstack mode how to traverse C stack: fp|dwarf|lbr|no

--begin function begin profiling when function is executed

--end function end profiling when function is executed

--ttsp time-to-safepoint profiling

--jfrsync config synchronize profiler with JFR recording

--lib path full path to libasyncProfiler.so in the container

--fdtransfer use fdtransfer to serve perf requests

from the non-privileged target

or 'jps' keyword to find running JVM automatically

or the application's name as it would appear in the jps tool

Example: ./profiler.sh -d 30 -f profile.html 3456

./profiler.sh start -i 999000 jps

./profiler.sh stop -o flat jps

./profiler.sh -d 5 -e alloc MyAppName

$ ./profiler.sh -e lock -d 10 -o flamegraph -f flamegraph.html 1245729

Viewing the Results

Start a temporary server such as `python3 -m http.server` in the directory where the saved flamegraph.html is located to make it accessible from outside. You can then view the profiling results through the web UI as shown below.

Helpful Videos for Understanding Async Profiler

- https://www.youtube.com/watch?v=H6glyrKQlg8

- https://www.youtube.com/watch?v=2nQk_DZgP9k

Quiz

Q1: What is the main topic covered in "Analyzing Java Processes with Async Profiler"?

Analyzing Java Processes with Async Profiler

Viewing the Results Start a temporary server such as python3 -m http.server in the directory where

the saved flamegraph.html is located to make it accessible from outside. You can then view the

profiling results through the web UI as shown below.

Q3: Explain the core concept of Helpful Videos for Understanding Async Profiler.

https://www.youtube.com/watch?v=H6glyrKQlg8 https://www.youtube.com/watch?v=2nQk_DZgP9k

현재 단락 (1/66)

I would like to introduce [Async Profiler](https://github.com/async-profiler/async-profiler), a soft...

작성 글자: 0원문 글자: 3,239작성 단락: 0/66