You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/doc/profiler.html

133 lines
121 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.51">
<style>
:root {
--c-bg: #fff;
}
html.dark {
--c-bg: #22272e;
}
html, body {
background-color: var(--c-bg);
}
</style>
<script>
const userMode = localStorage.getItem('vuepress-color-scheme');
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
document.documentElement.classList.toggle('dark', true);
}
</script>
<link rel="icon" href="/images/favicon.ico"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta property="og:title" content="Arthas"><meta property="og:image:alt" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - alibaba/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><meta property="og:image" content="/images/arthas_mate_image.png"><meta property="og:description" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - alibaba/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="600"><meta property="twitter:image:src" content="/images/arthas_mate_image.png"><meta property="twitter:image:alt" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - alibaba/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><meta itemprop="name" content="Arthas"><meta itemprop="image" content="/images/arthas_mate_image.png"><meta itemprop="description" content="Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas - alibaba/arthas: Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas"><script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?d5c5e25b100f0eb51a4c35c8a86ea9b4";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script><meta name="aes-config" content="pid=xux-opensource&user_type=101&uid=&username=&dim10=arthas"><script src="//g.alicdn.com/alilog/mlog/aplus_v2.js" id="beacon-aplus" exparams="clog=o&aplus&sidx=aplusSidx&ckx=aplusCkx"></script><script src="//g.alicdn.com/aes/??tracker/1.0.34/index.js,tracker-plugin-pv/2.4.5/index.js,tracker-plugin-event/1.2.5/index.js,tracker-plugin-jserror/1.0.13/index.js,tracker-plugin-api/1.1.14/index.js,tracker-plugin-perf/1.1.8/index.js,tracker-plugin-eventTiming/1.0.4/index.js"></script><title>profiler | arthas</title><meta name="description" content="arthas 使用文档">
<link rel="modulepreload" href="/assets/app.5024572d.js"><link rel="modulepreload" href="/assets/profiler.html.7d7d2c16.js"><link rel="modulepreload" href="/assets/arthas-output-svg.30f64f53.js"><link rel="modulepreload" href="/assets/profiler.html.3785275e.js"><link rel="prefetch" href="/assets/index.html.0310d6b7.js"><link rel="prefetch" href="/assets/index.html.26b36e14.js"><link rel="prefetch" href="/assets/index.html.f81666f3.js"><link rel="prefetch" href="/assets/advanced-use.html.d19ed71d.js"><link rel="prefetch" href="/assets/advice-class.html.1d3efc8d.js"><link rel="prefetch" href="/assets/agent.html.03c76533.js"><link rel="prefetch" href="/assets/arthas-properties.html.0a68e303.js"><link rel="prefetch" href="/assets/arthas3.html.e9ff98d3.js"><link rel="prefetch" href="/assets/async.html.2d7e17b7.js"><link rel="prefetch" href="/assets/auth.html.e6d4b91c.js"><link rel="prefetch" href="/assets/base64.html.867d2b97.js"><link rel="prefetch" href="/assets/batch-support.html.520a314a.js"><link rel="prefetch" href="/assets/cat.html.0e3f9bec.js"><link rel="prefetch" href="/assets/classloader.html.abb8c597.js"><link rel="prefetch" href="/assets/cls.html.67a6c0fd.js"><link rel="prefetch" href="/assets/commands.html.03ccce33.js"><link rel="prefetch" href="/assets/contact-us.html.fca90e78.js"><link rel="prefetch" href="/assets/dashboard.html.a1edecce.js"><link rel="prefetch" href="/assets/docker.html.71dad61b.js"><link rel="prefetch" href="/assets/download.html.d73305eb.js"><link rel="prefetch" href="/assets/dump.html.c3686557.js"><link rel="prefetch" href="/assets/echo.html.47b2931c.js"><link rel="prefetch" href="/assets/faq.html.6193ecbd.js"><link rel="prefetch" href="/assets/getstatic.html.90b40e46.js"><link rel="prefetch" href="/assets/grep.html.36066f19.js"><link rel="prefetch" href="/assets/groovy.html.041e64fb.js"><link rel="prefetch" href="/assets/heapdump.html.5f1f0a0f.js"><link rel="prefetch" href="/assets/help.html.cc8081c7.js"><link rel="prefetch" href="/assets/history.html.799a682b.js"><link rel="prefetch" href="/assets/http-api.html.6176e7ac.js"><link rel="prefetch" href="/assets/idea-plugin.html.a7268a5f.js"><link rel="prefetch" href="/assets/install-detail.html.8e837092.js"><link rel="prefetch" href="/assets/jad.html.2f34aa50.js"><link rel="prefetch" href="/assets/jfr.html.9b233b9d.js"><link rel="prefetch" href="/assets/jvm.html.66acd429.js"><link rel="prefetch" href="/assets/keymap.html.7cd121a8.js"><link rel="prefetch" href="/assets/logger.html.2598a2ad.js"><link rel="prefetch" href="/assets/manual-install.html.b48552bf.js"><link rel="prefetch" href="/assets/mbean.html.865d8303.js"><link rel="prefetch" href="/assets/mc.html.417d96c3.js"><link rel="prefetch" href="/assets/memory.html.bb61b4be.js"><link rel="prefetch" href="/assets/monitor.html.8168838f.js"><link rel="prefetch" href="/assets/ognl.html.5a4b1f35.js"><link rel="prefetch" href="/assets/options.html.4862477c.js"><link rel="prefetch" href="/assets/perfcounter.html.96e8509c.js"><link rel="prefetch" href="/assets/pwd.html.9d18ed39.js"><link rel="prefetch" href="/assets/quick-start.html.faa996a0.js"><link rel="prefetch" href="/assets/quit.html.99d279b0.js"><link rel="prefetch" href="/assets/redefine.html.c75cc086.js"><link rel="prefetch" href="/assets/release-notes.html.3c31db7c.js"><link rel="prefetch" href="/assets/reset.html.5a9cddf1.js"><link rel="prefetch" href="/assets/retransform.html.ce38448b.js"><link rel="prefetch" href="/assets/save-log.html.037bac18.js"><link rel="prefetch" href="/assets/sc.html.556dbf54.js"><link rel="prefetch" href="/assets/session.html.3205414e.js"><link rel="prefetch" href="/assets/sm.html.87672a15.js"><link rel="prefetch" href="/assets/spring-boot-starter.html.e00635b2.js"><link rel="prefetch" href="/assets/stack.html.82c27723.js"><link rel="prefetch" href="/assets/start-arthas.html.8895ebb1.js"><link rel="prefetch" href="/assets/stop.html.37513358.js"><link rel="prefetch" href="/assets/sysenv.html.fae02d4a.js"><link rel="prefetch" href="/assets/sysprop.html.0c2447a7.js"><link rel="prefetch" href="/assets/tee.html.65a6dcbf.js"><link rel="prefetch" href="/assets/thread.html.7d4f783c.js"><link rel="prefetch" href="/assets/trace.html.7fc97a55.js"><link rel="prefetch" href="/assets/tt.html.2f8ba6a9.js"><link rel="prefetch" href="/assets/tunnel.html.f6c95c19.js"><link rel="prefetch" href="/assets/version.html.65d1d217.js"><link rel="prefetch" href="/assets/vmoption.html.4a4452fc.js"><link rel="prefetch" href="/assets/vmtool.html.785e15b0.js"><link rel="prefetch" href="/assets/watch.html.8ab01f20.js"><link rel="prefetch" href="/assets/web-console.html.ee889bc8.js"><link rel="prefetch" href="/assets/index.html.4473f26b.js"><link rel="prefetch" href="/assets/advanced-use.html.1a28f6a5.js"><link rel="prefetch" href="/assets/advice-class.html.d8ad50b3.js"><link rel="prefetch" href="/assets/agent.html.7961745e.js"><link rel="prefetch" href="/assets/arthas-properties.html.8021fe71.js"><link rel="prefetch" href="/assets/async.html.cee6c639.js"><link rel="prefetch" href="/assets/auth.html.d9567203.js"><link rel="prefetch" href="/assets/base64.html.f23d1c1a.js"><link rel="prefetch" href="/assets/batch-support.html.316cd7e8.js"><link rel="prefetch" href="/assets/cat.html.4335c5dc.js"><link rel="prefetch" href="/assets/classloader.html.bf7956ab.js"><link rel="prefetch" href="/assets/cls.html.97d2b84f.js"><link rel="prefetch" href="/assets/commands.html.15628afe.js"><link rel="prefetch" href="/assets/contact-us.html.903f2e33.js"><link rel="prefetch" href="/assets/dashboard.html.bcc51fa6.js"><link rel="prefetch" href="/assets/docker.html.6569bd54.js"><link rel="prefetch" href="/assets/download.html.c6ec554d.js"><link rel="prefetch" href="/assets/dump.html.ceb6ce3f.js"><link rel="prefetch" href="/assets/echo.html.78d074ba.js"><link rel="prefetch" href="/assets/faq.html.ae91bbb1.js"><link rel="prefetch" href="/assets/getstatic.html.238af461.js"><link rel="prefetch" href="/assets/grep.html.765b9db4.js"><link rel="prefetch" href="/assets/groovy.html.07ba29d4.js"><link rel="prefetch" href="/assets/heapdump.html.45aa4058.js"><link rel="prefetch" href="/assets/help.html.6b5e680d.js"><link rel="prefetch" href="/assets/history.html.cbd4f1dc.js"><link rel="prefetch" href="/assets/http-api.html.08106e49.js"><link rel="prefetch" href="/assets/idea-plugin.html.696d1a9b.js"><link rel="prefetch" href="/assets/install-detail.html.ada22454.js"><link rel="prefetch" href="/assets/jad.html.a61a52e4.js"><link rel="prefetch" href="/assets/jfr.html.a65beb58.js"><link rel="prefetch" href="/assets/jvm.html.b8b1aa17.js"><link rel="prefetch" href="/assets/keymap.html.4b97d548.js"><link rel="prefetch" href="/assets/logger.html.4c886eeb.js"><link rel="prefetch" href="/assets/manual-install.html.b1712f99.js"><link rel="prefetch" href="/assets/mbean.html.e50ffcee.js"><link rel="prefetch" href="/assets/mc.html.aa0438cf.js"><link rel="prefetch" href="/assets/memory.html.bc85782d.js"><link rel="prefetch" href="/assets/monitor.html.c8fd104a.js"><link rel="prefetch" href="/assets/ognl.html.5fa32203.js"><link rel="prefetch" href="/assets/options.html.e9d3bf7d.js"><link rel="prefetch" href="/assets/perfcounter.html.6022385f.js"><link rel="prefetch" href="/assets/profiler.html.6187e56a.js"><link rel="prefetch" href="/assets/pwd.html.ac6fa9ed.js"><link rel="prefetch" href="/assets/quick-start.html.e2dbf20d.js"><link rel="prefetch" href="/assets/quit.html.3576a0df.js"><link rel="prefetch" href="/assets/redefine.html.647030fe.js"><link rel="prefetch" href="/assets/release-notes.html.9cd9ef9a.js"><link rel="prefetch" href="/assets/reset.html.aea64667.js"><link rel="prefetch" href="/assets/retransform.html.d2256f08.js"><link rel="prefetch" href="/assets/save-log.html.2e2ab47b.js"><link rel="prefetch" href="/assets/sc.html.73cdcc54.js"><link rel="prefetch" href="/assets/session.html.f299a357.js"><link rel="prefetch" href="/assets/sm.html.6fb2da77.js"><link rel="prefetch" href="/assets/spring-boot-starter.html.d3fe861a.js"><link rel="prefetch" href="/assets/stack.html.3a3543ef.js"><link rel="prefetch" href="/assets/start-arthas.html.89aedbd5.js"><link rel="prefetch" href="/assets/stop.html.375aab78.js"><link rel="prefetch" href="/assets/sysenv.html.eebfa441.js"><link rel="prefetch" href="/assets/sysprop.html.d2af9b76.js"><link rel="prefetch" href="/assets/tee.html.3b901b19.js"><link rel="prefetch" href="/assets/thread.html.7bd6ce5a.js"><link rel="prefetch" href="/assets/trace.html.1816b5e5.js"><link rel="prefetch" href="/assets/tt.html.9fd40d2c.js"><link rel="prefetch" href="/assets/tunnel.html.c4dbd72e.js"><link rel="prefetch" href="/assets/version.html.94606777.js"><link rel="prefetch" href="/assets/vmoption.html.07f6d06f.js"><link rel="prefetch" href="/assets/vmtool.html.6ca46c5c.js"><link rel="prefetch" href="/assets/watch.html.61dde141.js"><link rel="prefetch" href="/assets/web-console.html.7f55a6b5.js"><link rel="prefetch" href="/assets/intro.html.fb69e77b.js"><link rel="prefetch" href="/assets/user-question-history11440.html.0050c901.js"><link rel="prefetch" href="/assets/user-question-history11442.html.2b6f935c.js"><link rel="prefetch" href="/assets/user-question-history11443.html.f6cd4964.js"><link rel="prefetch" href="/assets/user-question-history11444.html.ce992129.js"><link rel="prefetch" href="/assets/user-question-history11450.html.2756279b.js"><link rel="prefetch" href="/assets/user-question-history11451.html.3d594a86.js"><link rel="prefetch" href="/assets/user-question-history11452.html.e94aac28.js"><link rel="prefetch" href="/assets/user-question-history11453.html.8a135789.js"><link rel="prefetch" href="/assets/user-question-history11454.html.7bbd3f53.js"><link rel="prefetch" href="/assets/user-question-history11466.html.6a554403.js"><link rel="prefetch" href="/assets/user-question-history11467.html.dfe7d3f0.js"><link rel="prefetch" href="/assets/user-question-history11468.html.07400649.js"><link rel="prefetch" href="/assets/user-question-history11469.html.267c96b6.js"><link rel="prefetch" href="/assets/user-question-history11784.html.56fcf97f.js"><link rel="prefetch" href="/assets/user-question-history11795.html.d21e8e72.js"><link rel="prefetch" href="/assets/user-question-history11809.html.47e34f67.js"><link rel="prefetch" href="/assets/user-question-history11810.html.3f2e0760.js"><link rel="prefetch" href="/assets/user-question-history11814.html.89c2563e.js"><link rel="prefetch" href="/assets/user-question-history12453.html.163bc9ad.js"><link rel="prefetch" href="/assets/user-question-history12454.html.fcccb708.js"><link rel="prefetch" href="/assets/user-question-history12455.html.3aed1fc8.js"><link rel="prefetch" href="/assets/user-question-history12706.html.3cf454ba.js"><link rel="prefetch" href="/assets/user-question-history12715.html.824bab31.js"><link rel="prefetch" href="/assets/user-question-history12716.html.aea93112.js"><link rel="prefetch" href="/assets/user-question-history12740.html.6d3a85f1.js"><link rel="prefetch" href="/assets/user-question-history12741.html.7155ebde.js"><link rel="prefetch" href="/assets/user-question-history13448.html.a659e900.js"><link rel="prefetch" href="/assets/user-question-history13504.html.f86b0c17.js"><link rel="prefetch" href="/assets/user-question-history13506.html.756c0aef.js"><link rel="prefetch" href="/assets/user-question-history13507.html.b410fde5.js"><link rel="prefetch" href="/assets/user-question-history13508.html.3cfbd3ac.js"><link rel="prefetch" href="/assets/user-question-history13509.html.be494725.js"><link rel="prefetch" href="/assets/user-question-history13510.html.4b10ee98.js"><link rel="prefetch" href="/assets/user-question-history13511.html.a4c61493.js"><link rel="prefetch" href="/assets/user-question-history13512.html.e198ca8d.js"><link rel="prefetch" href="/assets/user-question-history13513.html.e75202ae.js"><link rel="prefetch" href="/assets/user-question-history13522.html.46939f73.js"><link rel="prefetch" href="/assets/user-question-history14763.html.140717c7.js"><link rel="prefetch" href="/assets/user-question-history14831.html.de4216e5.js"><link rel="prefetch" href="/assets/user-question-history14832.html.22fc1910.js"><link rel="prefetch" href="/assets/user-question-history14833.html.b17c1b6b.js"><link rel="prefetch" href="/assets/user-question-history14834.html.e96bfd10.js"><link rel="prefetch" href="/assets/user-question-history14840.html.b43bc59a.js"><link rel="prefetch" href="/assets/user-question-history14843.html.f49a7feb.js"><link rel="prefetch" href="/assets/user-question-history15167.html.1f0041fe.js"><link rel="prefetch" href="/assets/user-question-history15543.html.8f8a0315.js"><link rel="prefetch" href="/assets/user-question-history15726.html.fd6ce750.js"><link rel="prefetch" href="/assets/user-question-history15728.html.ccdc912d.js"><link rel="prefetch" href="/assets/user-question-history15729.html.471a1b8f.js"><link rel="prefetch" href="/assets/user-question-history15730.html.bd03a518.js"><link rel="prefetch" href="/assets/user-question-history15731.html.559f9f08.js"><link rel="prefetch" href="/assets/user-question-history15735.html.80cab5b9.js"><link rel="prefetch" href="/assets/user-question-history15736.html.412f1499.js"><link rel="prefetch" href="/assets/user-question-history15737.html.18923199.js"><link rel="prefetch" href="/assets/user-question-history15738.html.6ceeca93.js"><link rel="prefetch" href="/assets/user-question-history15739.html.86e3a2dc.js"><link rel="prefetch" href="/assets/user-question-history15740.html.e1844f14.js"><link rel="prefetch" href="/assets/404.html.954ede21.js"><link rel="prefetch" href="/assets/index.html.30ce3385.js"><link rel="prefetch" href="/assets/index.html.a40e9b51.js"><link rel="prefetch" href="/assets/index.html.d646c9e0.js"><link rel="prefetch" href="/assets/advanced-use.html.69173a07.js"><link rel="prefetch" href="/assets/advice-class.html.44dc3045.js"><link rel="prefetch" href="/assets/agent.html.76c735d0.js"><link rel="prefetch" href="/assets/arthas-properties.html.81d42c35.js"><link rel="prefetch" href="/assets/arthas3.html.0b19650f.js"><link rel="prefetch" href="/assets/async.html.dda2afae.js"><link rel="prefetch" href="/assets/auth.html.07bdc876.js"><link rel="prefetch" href="/assets/base64.html.bcead116.js"><link rel="prefetch" href="/assets/batch-support.html.4641bd67.js"><link rel="prefetch" href="/assets/cat.html.17a41250.js"><link rel="prefetch" href="/assets/classloader.html.4284e89d.js"><link rel="prefetch" href="/assets/cls.html.7418b29d.js"><link rel="prefetch" href="/assets/commands.html.9195266b.js"><link rel="prefetch" href="/assets/contact-us.html.5761289f.js"><link rel="prefetch" href="/assets/dashboard.html.a121fb6b.js"><link rel="prefetch" href="/assets/docker.html.03d1872a.js"><link rel="prefetch" href="/assets/download.html.17050c97.js"><link rel="prefetch" href="/assets/dump.html.150553f5.js"><link rel="prefetch" href="/assets/echo.html.b6e5f092.js"><link rel="prefetch" href="/assets/faq.html.0adab3f6.js"><link rel="prefetch" href="/assets/getstatic.html.585460ac.js"><link rel="prefetch" href="/assets/grep.html.7bfe65a7.js"><link rel="prefetch" href="/assets/groovy.html.9814fe6a.js"><link rel="prefetch" href="/assets/heapdump.html.03900a35.js"><link rel="prefetch" href="/assets/help.html.1a9f5df9.js"><link rel="prefetch" href="/assets/history.html.7fdc3fbc.js"><link rel="prefetch" href="/assets/http-api.html.d43050d6.js"><link rel="prefetch" href="/assets/idea-plugin.html.eaa87fb3.js"><link rel="prefetch" href="/assets/install-detail.html.c7db59fe.js"><link rel="prefetch" href="/assets/jad.html.538333fc.js"><link rel="prefetch" href="/assets/jfr.html.5892aad4.js"><link rel="prefetch" href="/assets/jvm.html.a09c582f.js"><link rel="prefetch" href="/assets/keymap.html.f350d350.js"><link rel="prefetch" href="/assets/logger.html.77aef58f.js"><link rel="prefetch" href="/assets/manual-install.html.b52b3383.js"><link rel="prefetch" href="/assets/mbean.html.fb10ca7f.js"><link rel="prefetch" href="/assets/mc.html.5651a161.js"><link rel="prefetch" href="/assets/memory.html.51f06c97.js"><link rel="prefetch" href="/assets/monitor.html.0c917472.js"><link rel="prefetch" href="/assets/ognl.html.51c27cdf.js"><link rel="prefetch" href="/assets/options.html.061c0499.js"><link rel="prefetch" href="/assets/perfcounter.html.7a2e7783.js"><link rel="prefetch" href="/assets/pwd.html.94331a5b.js"><link rel="prefetch" href="/assets/quick-start.html.d0d7d085.js"><link rel="prefetch" href="/assets/quit.html.07d23945.js"><link rel="prefetch" href="/assets/redefine.html.b51d4760.js"><link rel="prefetch" href="/assets/release-notes.html.97884707.js"><link rel="prefetch" href="/assets/reset.html.8d888519.js"><link rel="prefetch" href="/assets/retransform.html.33e2a183.js"><link rel="prefetch" href="/assets/save-log.html.65bbf18d.js"><link rel="prefetch" href="/assets/sc.html.b97ba863.js"><link rel="prefetch" href="/assets/session.html.f12fb284.js"><link rel="prefetch" href="/assets/sm.html.b1573b78.js"><link rel="prefetch" href="/assets/spring-boot-starter.html.62c01266.js"><link rel="prefetch" href="/assets/stack.html.f9218289.js"><link rel="prefetch" href="/assets/start-arthas.html.386fe5e8.js"><link rel="prefetch" href="/assets/stop.html.1809fc4b.js"><link rel="prefetch" href="/assets/sysenv.html.d3ed1a43.js"><link rel="prefetch" href="/assets/sysprop.html.d5a36f08.js"><link rel="prefetch" href="/assets/tee.html.100828a3.js"><link rel="prefetch" href="/assets/thread.html.1c837b34.js"><link rel="prefetch" href="/assets/trace.html.29692689.js"><link rel="prefetch" href="/assets/tt.html.23b440e4.js"><link rel="prefetch" href="/assets/tunnel.html.b5499e98.js"><link rel="prefetch" href="/assets/version.html.3e704c32.js"><link rel="prefetch" href="/assets/vmoption.html.82b62241.js"><link rel="prefetch" href="/assets/vmtool.html.aa90ec1f.js"><link rel="prefetch" href="/assets/watch.html.6bbe9bc3.js"><link rel="prefetch" href="/assets/web-console.html.dbc0dbf0.js"><link rel="prefetch" href="/assets/index.html.4201d415.js"><link rel="prefetch" href="/assets/advanced-use.html.90868e26.js"><link rel="prefetch" href="/assets/advice-class.html.0ca455a3.js"><link rel="prefetch" href="/assets/agent.html.251dddae.js"><link rel="prefetch" href="/assets/arthas-properties.html.938af046.js"><link rel="prefetch" href="/assets/async.html.5ce1d1ce.js"><link rel="prefetch" href="/assets/auth.html.2a003b09.js"><link rel="prefetch" href="/assets/base64.html.00f201c7.js"><link rel="prefetch" href="/assets/batch-support.html.6043e5f6.js"><link rel="prefetch" href="/assets/cat.html.6b2e0086.js"><link rel="prefetch" href="/assets/classloader.html.413109bd.js"><link rel="prefetch" href="/assets/cls.html.29b1f806.js"><link rel="prefetch" href="/assets/commands.html.e8942ef3.js"><link rel="prefetch" href="/assets/contact-us.html.4526730f.js"><link rel="prefetch" href="/assets/dashboard.html.7edf7acb.js"><link rel="prefetch" href="/assets/docker.html.03ba71a6.js"><link rel="prefetch" href="/assets/download.html.8810095d.js"><link rel="prefetch" href="/assets/dump.html.4991b48d.js"><link rel="prefetch" href="/assets/echo.html.7650a83b.js"><link rel="prefetch" href="/assets/faq.html.ea3e918c.js"><link rel="prefetch" href="/assets/getstatic.html.500e6219.js"><link rel="prefetch" href="/assets/grep.html.bf503089.js"><link rel="prefetch" href="/assets/groovy.html.49d078a1.js"><link rel="prefetch" href="/assets/heapdump.html.660526d5.js"><link rel="prefetch" href="/assets/help.html.e42cbec6.js"><link rel="prefetch" href="/assets/history.html.5ede54ab.js"><link rel="prefetch" href="/assets/http-api.html.9ba1dee0.js"><link rel="prefetch" href="/assets/idea-plugin.html.f5332dbc.js"><link rel="prefetch" href="/assets/install-detail.html.71fdac53.js"><link rel="prefetch" href="/assets/jad.html.6c5585d2.js"><link rel="prefetch" href="/assets/jfr.html.10e316af.js"><link rel="prefetch" href="/assets/jvm.html.c7b9fd8f.js"><link rel="prefetch" href="/assets/keymap.html.97636b0c.js"><link rel="prefetch" href="/assets/logger.html.ab691e29.js"><link rel="prefetch" href="/assets/manual-install.html.a031e342.js"><link rel="prefetch" href="/assets/mbean.html.9062fe0b.js"><link rel="prefetch" href="/assets/mc.html.c72bf29a.js"><link rel="prefetch" href="/assets/memory.html.911264fb.js"><link rel="prefetch" href="/assets/monitor.html.b861dd2b.js"><link rel="prefetch" href="/assets/ognl.html.d4bc1bc8.js"><link rel="prefetch" href="/assets/options.html.9e19bd7d.js"><link rel="prefetch" href="/assets/perfcounter.html.e3509839.js"><link rel="prefetch" href="/assets/profiler.html.9a5939c8.js"><link rel="prefetch" href="/assets/pwd.html.8c00c7c7.js"><link rel="prefetch" href="/assets/quick-start.html.17597d6b.js"><link rel="prefetch" href="/assets/quit.html.f2004fd3.js"><link rel="prefetch" href="/assets/redefine.html.8f763ba4.js"><link rel="prefetch" href="/assets/release-notes.html.ceca27da.js"><link rel="prefetch" href="/assets/reset.html.531c57ec.js"><link rel="prefetch" href="/assets/retransform.html.883cb847.js"><link rel="prefetch" href="/assets/save-log.html.10fd1804.js"><link rel="prefetch" href="/assets/sc.html.e5ed7927.js"><link rel="prefetch" href="/assets/session.html.792ab981.js"><link rel="prefetch" href="/assets/sm.html.b6c4fc05.js"><link rel="prefetch" href="/assets/spring-boot-starter.html.4487a31e.js"><link rel="prefetch" href="/assets/stack.html.b1dc93b3.js"><link rel="prefetch" href="/assets/start-arthas.html.0c0dcba7.js"><link rel="prefetch" href="/assets/stop.html.b94ef499.js"><link rel="prefetch" href="/assets/sysenv.html.dd2920eb.js"><link rel="prefetch" href="/assets/sysprop.html.9ee76be9.js"><link rel="prefetch" href="/assets/tee.html.690e39e8.js"><link rel="prefetch" href="/assets/thread.html.989bc148.js"><link rel="prefetch" href="/assets/trace.html.272a5864.js"><link rel="prefetch" href="/assets/tt.html.5ad78537.js"><link rel="prefetch" href="/assets/tunnel.html.59bde372.js"><link rel="prefetch" href="/assets/version.html.1fb9c5ad.js"><link rel="prefetch" href="/assets/vmoption.html.4f720b39.js"><link rel="prefetch" href="/assets/vmtool.html.a6a8ee75.js"><link rel="prefetch" href="/assets/watch.html.06497348.js"><link rel="prefetch" href="/assets/web-console.html.1d818a20.js"><link rel="prefetch" href="/assets/intro.html.0082fd51.js"><link rel="prefetch" href="/assets/user-question-history11440.html.fb0525c1.js"><link rel="prefetch" href="/assets/user-question-history11442.html.e0a55c65.js"><link rel="prefetch" href="/assets/user-question-history11443.html.d1528876.js"><link rel="prefetch" href="/assets/user-question-history11444.html.e2b6bc77.js"><link rel="prefetch" href="/assets/user-question-history11450.html.2b09f6c7.js"><link rel="prefetch" href="/assets/user-question-history11451.html.c76df7ae.js"><link rel="prefetch" href="/assets/user-question-history11452.html.9879b76b.js"><link rel="prefetch" href="/assets/user-question-history11453.html.2e92595b.js"><link rel="prefetch" href="/assets/user-question-history11454.html.f568c6c3.js"><link rel="prefetch" href="/assets/user-question-history11466.html.3fc8a828.js"><link rel="prefetch" href="/assets/user-question-history11467.html.bb6b861a.js"><link rel="prefetch" href="/assets/user-question-history11468.html.46029e3a.js"><link rel="prefetch" href="/assets/user-question-history11469.html.ab94d023.js"><link rel="prefetch" href="/assets/user-question-history11784.html.a62744ce.js"><link rel="prefetch" href="/assets/user-question-history11795.html.a7d68a33.js"><link rel="prefetch" href="/assets/user-question-history11809.html.f163cb5f.js"><link rel="prefetch" href="/assets/user-question-history11810.html.38c867bc.js"><link rel="prefetch" href="/assets/user-question-history11814.html.225c060b.js"><link rel="prefetch" href="/assets/user-question-history12453.html.36bebf20.js"><link rel="prefetch" href="/assets/user-question-history12454.html.3ee1574c.js"><link rel="prefetch" href="/assets/user-question-history12455.html.4d2487f7.js"><link rel="prefetch" href="/assets/user-question-history12706.html.5d0d9e70.js"><link rel="prefetch" href="/assets/user-question-history12715.html.fe834021.js"><link rel="prefetch" href="/assets/user-question-history12716.html.86dedfd1.js"><link rel="prefetch" href="/assets/user-question-history12740.html.58af5398.js"><link rel="prefetch" href="/assets/user-question-history12741.html.d9c4d211.js"><link rel="prefetch" href="/assets/user-question-history13448.html.8cc59a67.js"><link rel="prefetch" href="/assets/user-question-history13504.html.b57725ff.js"><link rel="prefetch" href="/assets/user-question-history13506.html.0039dbf9.js"><link rel="prefetch" href="/assets/user-question-history13507.html.2c3580b6.js"><link rel="prefetch" href="/assets/user-question-history13508.html.611f806a.js"><link rel="prefetch" href="/assets/user-question-history13509.html.25c5b6f6.js"><link rel="prefetch" href="/assets/user-question-history13510.html.cc949a92.js"><link rel="prefetch" href="/assets/user-question-history13511.html.6a3406dd.js"><link rel="prefetch" href="/assets/user-question-history13512.html.b13b9408.js"><link rel="prefetch" href="/assets/user-question-history13513.html.db786eb4.js"><link rel="prefetch" href="/assets/user-question-history13522.html.d86e15d9.js"><link rel="prefetch" href="/assets/user-question-history14763.html.e50d35b1.js"><link rel="prefetch" href="/assets/user-question-history14831.html.5aaf9c3b.js"><link rel="prefetch" href="/assets/user-question-history14832.html.851282a7.js"><link rel="prefetch" href="/assets/user-question-history14833.html.37da3c74.js"><link rel="prefetch" href="/assets/user-question-history14834.html.f09d5dea.js"><link rel="prefetch" href="/assets/user-question-history14840.html.e8ff334a.js"><link rel="prefetch" href="/assets/user-question-history14843.html.77cae64b.js"><link rel="prefetch" href="/assets/user-question-history15167.html.281cc072.js"><link rel="prefetch" href="/assets/user-question-history15543.html.0cbc55e8.js"><link rel="prefetch" href="/assets/user-question-history15726.html.40b6ceb9.js"><link rel="prefetch" href="/assets/user-question-history15728.html.5cfa5a28.js"><link rel="prefetch" href="/assets/user-question-history15729.html.ec291ed8.js"><link rel="prefetch" href="/assets/user-question-history15730.html.4bca5864.js"><link rel="prefetch" href="/assets/user-question-history15731.html.a3a956ae.js"><link rel="prefetch" href="/assets/user-question-history15735.html.7ea6b4e5.js"><link rel="prefetch" href="/assets/user-question-history15736.html.88204631.js"><link rel="prefetch" href="/assets/user-question-history15737.html.2c7d5321.js"><link rel="prefetch" href="/assets/user-question-history15738.html.1ec98456.js"><link rel="prefetch" href="/assets/user-question-history15739.html.2ab5138c.js"><link rel="prefetch" href="/assets/user-question-history15740.html.b1ca6209.js"><link rel="prefetch" href="/assets/404.html.49fbe4f8.js">
<link rel="stylesheet" href="/assets/style.cf0d4c26.css">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="切换侧边栏" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/" class="" data-v-a8869d06><!----><span class="site-name can-hide" data-v-a8869d06>arthas</span><span class="navbar-version" data-v-a8869d06>v4.0.4</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a href="/" class="" aria-label="首页"><!--[--><!--]--> 首页 <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="/doc/arthas-tutorials.html?language=cn&amp;id=arthas-basics" rel="noopener noreferrer" target="_blank" aria-label="在线教程"><!--[--><!--]--><span>在线教程</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/" class="router-link-active" aria-label="文档"><!--[--><!--]--> 文档 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/commands.md" class="" aria-label="命令列表"><!--[--><!--]--> 命令列表 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/download.md" class="" aria-label="下载"><!--[--><!--]--> 下载 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/expert/intro.md" class="" aria-label="专家答疑"><!--[--><!--]--> 专家答疑 <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="版本"><span class="title">版本</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="版本"><span class="title">版本</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://arthas.aliyun.com/3.x/" rel="noopener noreferrer" target="_blank" aria-label="v3.x"><!--[--><!--]--><span>v3.x</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em" style="height:1.25rem;width:1.25rem;vertical-align:bottom;" viewbox="0 0 24 24"><path fill="currentColor" d="M13.35 22q-.6 0-.862-.387q-.263-.388-.063-.963l3.65-9.675q.15-.4.563-.688Q17.05 10 17.5 10q.425 0 .85.287q.425.288.575.688l3.65 9.675q.2.575-.062.963q-.263.387-.888.387q-.275 0-.5-.175q-.225-.175-.325-.425l-.85-2.45H15.1l-.875 2.45q-.1.25-.35.425q-.25.175-.525.175Zm2.35-4.8h3.6l-1.75-4.95h-.1ZM7.15 8.55q.4.725.85 1.337q.45.613 1.05 1.263q1.1-1.2 1.825-2.462Q11.6 7.425 12.1 6H2q-.425 0-.712-.287Q1 5.425 1 5t.288-.713Q1.575 4 2 4h6V3q0-.425.288-.713Q8.575 2 9 2t.713.287Q10 2.575 10 3v1h6q.425 0 .712.287Q17 4.575 17 5t-.288.713Q16.425 6 16 6h-1.9q-.525 1.775-1.425 3.45q-.9 1.675-2.225 3.15l2.4 2.45l-.75 2.05L9 14l-4.3 4.3q-.275.275-.7.275q-.425 0-.7-.275q-.275-.275-.275-.7q0-.425.275-.7l4.35-4.35q-.675-.775-1.25-1.563q-.575-.787-1.025-1.662Q5.1 8.8 5.35 8.4t.875-.4q.25 0 .525.162q.275.163.4.388Z"></path></svg><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em" style="height:1.25rem;width:1.25rem;vertical-align:bottom;" viewbox="0 0 24 24"><path fill="currentColor" d="M13.35 22q-.6 0-.862-.387q-.263-.388-.063-.963l3.65-9.675q.15-.4.563-.688Q17.05 10 17.5 10q.425 0 .85.287q.425.288.575.688l3.65 9.675q.2.575-.062.963q-.263.387-.888.387q-.275 0-.5-.175q-.225-.175-.325-.425l-.85-2.45H15.1l-.875 2.45q-.1.25-.35.425q-.25.175-.525.175Zm2.35-4.8h3.6l-1.75-4.95h-.1ZM7.15 8.55q.4.725.85 1.337q.45.613 1.05 1.263q1.1-1.2 1.825-2.462Q11.6 7.425 12.1 6H2q-.425 0-.712-.287Q1 5.425 1 5t.288-.713Q1.575 4 2 4h6V3q0-.425.288-.713Q8.575 2 9 2t.713.287Q10 2.575 10 3v1h6q.425 0 .712.287Q17 4.575 17 5t-.288.713Q16.425 6 16 6h-1.9q-.525 1.775-1.425 3.45q-.9 1.675-2.225 3.15l2.4 2.45l-.75 2.05L9 14l-4.3 4.3q-.275.275-.7.275q-.425 0-.7-.275q-.275-.275-.275-.7q0-.425.275-.7l4.35-4.35q-.675-.775-1.25-1.563q-.575-.787-1.025-1.662Q5.1 8.8 5.35 8.4t.875-.4q.25 0 .525.162q.275.163.4.388Z"></path></svg><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/doc/profiler.html" class="router-link-active router-link-exact-active router-link-active" aria-label="简体中文"><!--[--><!--]--> 简体中文 <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/en/doc/profiler.html" class="" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/alibaba/arthas" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" style="height:1.25rem;width:1.25rem;vertical-align:bottom;"><path fill="currentColor" d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33c.85 0 1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2Z"></path></svg><!----><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-color-mode-button" title="切换颜色模式"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><div id="docsearch-container"></div></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><a href="/" class="" aria-label="首页"><!--[--><!--]--> 首页 <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="/doc/arthas-tutorials.html?language=cn&amp;id=arthas-basics" rel="noopener noreferrer" target="_blank" aria-label="在线教程"><!--[--><!--]--><span>在线教程</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/" class="router-link-active" aria-label="文档"><!--[--><!--]--> 文档 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/commands.md" class="" aria-label="命令列表"><!--[--><!--]--> 命令列表 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/download.md" class="" aria-label="下载"><!--[--><!--]--> 下载 <!--[--><!--]--></a></div><div class="navbar-item"><a href="/doc/expert/intro.md" class="" aria-label="专家答疑"><!--[--><!--]--> 专家答疑 <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="版本"><span class="title">版本</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="版本"><span class="title">版本</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a class="external-link" href="https://arthas.aliyun.com/3.x/" rel="noopener noreferrer" target="_blank" aria-label="v3.x"><!--[--><!--]--><span>v3.x</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em" style="height:1.25rem;width:1.25rem;vertical-align:bottom;" viewbox="0 0 24 24"><path fill="currentColor" d="M13.35 22q-.6 0-.862-.387q-.263-.388-.063-.963l3.65-9.675q.15-.4.563-.688Q17.05 10 17.5 10q.425 0 .85.287q.425.288.575.688l3.65 9.675q.2.575-.062.963q-.263.387-.888.387q-.275 0-.5-.175q-.225-.175-.325-.425l-.85-2.45H15.1l-.875 2.45q-.1.25-.35.425q-.25.175-.525.175Zm2.35-4.8h3.6l-1.75-4.95h-.1ZM7.15 8.55q.4.725.85 1.337q.45.613 1.05 1.263q1.1-1.2 1.825-2.462Q11.6 7.425 12.1 6H2q-.425 0-.712-.287Q1 5.425 1 5t.288-.713Q1.575 4 2 4h6V3q0-.425.288-.713Q8.575 2 9 2t.713.287Q10 2.575 10 3v1h6q.425 0 .712.287Q17 4.575 17 5t-.288.713Q16.425 6 16 6h-1.9q-.525 1.775-1.425 3.45q-.9 1.675-2.225 3.15l2.4 2.45l-.75 2.05L9 14l-4.3 4.3q-.275.275-.7.275q-.425 0-.7-.275q-.275-.275-.275-.7q0-.425.275-.7l4.35-4.35q-.675-.775-1.25-1.563q-.575-.787-1.025-1.662Q5.1 8.8 5.35 8.4t.875-.4q.25 0 .525.162q.275.163.4.388Z"></path></svg><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em" style="height:1.25rem;width:1.25rem;vertical-align:bottom;" viewbox="0 0 24 24"><path fill="currentColor" d="M13.35 22q-.6 0-.862-.387q-.263-.388-.063-.963l3.65-9.675q.15-.4.563-.688Q17.05 10 17.5 10q.425 0 .85.287q.425.288.575.688l3.65 9.675q.2.575-.062.963q-.263.387-.888.387q-.275 0-.5-.175q-.225-.175-.325-.425l-.85-2.45H15.1l-.875 2.45q-.1.25-.35.425q-.25.175-.525.175Zm2.35-4.8h3.6l-1.75-4.95h-.1ZM7.15 8.55q.4.725.85 1.337q.45.613 1.05 1.263q1.1-1.2 1.825-2.462Q11.6 7.425 12.1 6H2q-.425 0-.712-.287Q1 5.425 1 5t.288-.713Q1.575 4 2 4h6V3q0-.425.288-.713Q8.575 2 9 2t.713.287Q10 2.575 10 3v1h6q.425 0 .712.287Q17 4.575 17 5t-.288.713Q16.425 6 16 6h-1.9q-.525 1.775-1.425 3.45q-.9 1.675-2.225 3.15l2.4 2.45l-.75 2.05L9 14l-4.3 4.3q-.275.275-.7.275q-.425 0-.7-.275q-.275-.275-.275-.7q0-.425.275-.7l4.35-4.35q-.675-.775-1.25-1.563q-.575-.787-1.025-1.662Q5.1 8.8 5.35 8.4t.875-.4q.25 0 .525.162q.275.163.4.388Z"></path></svg><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/doc/profiler.html" class="router-link-active router-link-exact-active router-link-active" aria-label="简体中文"><!--[--><!--]--> 简体中文 <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/en/doc/profiler.html" class="" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/alibaba/arthas" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" style="height:1.25rem;width:1.25rem;vertical-align:bottom;"><path fill="currentColor" d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33c.85 0 1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2Z"></path></svg><!----><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><p tabindex="0" class="sidebar-item sidebar-heading active">文档 <!----></p><ul style="" class="sidebar-item-children"><!--[--><li><a href="/doc/" class="router-link-active sidebar-item" aria-label="简介"><!--[--><!--]--> 简介 <!--[--><!--]--></a><!----></li><li><a href="/doc/quick-start.html" class="sidebar-item" aria-label="快速入门"><!--[--><!--]--> 快速入门 <!--[--><!--]--></a><!----></li><li><a href="/doc/install-detail.html" class="sidebar-item" aria-label="Arthas Install"><!--[--><!--]--> Arthas Install <!--[--><!--]--></a><!----></li><li><a href="/doc/download.html" class="sidebar-item" aria-label="下载"><!--[--><!--]--> 下载 <!--[--><!--]--></a><!----></li><li><a href="/doc/advice-class.html" class="sidebar-item" aria-label="表达式核心变量"><!--[--><!--]--> 表达式核心变量 <!--[--><!--]--></a><!----></li><li><a href="/doc/commands.md" class="sidebar-item active collapsible" aria-label="命令列表"><!--[--><!--]--> 命令列表 <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a href="/doc/auth.html" class="sidebar-item" aria-label="auth"><!--[--><!--]--> auth <!--[--><!--]--></a><!----></li><li><a href="/doc/base64.html" class="sidebar-item" aria-label="base64"><!--[--><!--]--> base64 <!--[--><!--]--></a><!----></li><li><a href="/doc/cat.html" class="sidebar-item" aria-label="cat"><!--[--><!--]--> cat <!--[--><!--]--></a><!----></li><li><a href="/doc/classloader.html" class="sidebar-item" aria-label="classloader"><!--[--><!--]--> classloader <!--[--><!--]--></a><!----></li><li><a href="/doc/cls.html" class="sidebar-item" aria-label="cls"><!--[--><!--]--> cls <!--[--><!--]--></a><!----></li><li><a href="/doc/dashboard.html" class="sidebar-item" aria-label="dashboard"><!--[--><!--]--> dashboard <!--[--><!--]--></a><!----></li><li><a href="/doc/dump.html" class="sidebar-item" aria-label="dump"><!--[--><!--]--> dump <!--[--><!--]--></a><!----></li><li><a href="/doc/echo.html" class="sidebar-item" aria-label="echo"><!--[--><!--]--> echo <!--[--><!--]--></a><!----></li><li><a href="/doc/getstatic.html" class="sidebar-item" aria-label="getstatic"><!--[--><!--]--> getstatic <!--[--><!--]--></a><!----></li><li><a href="/doc/grep.html" class="sidebar-item" aria-label="grep"><!--[--><!--]--> grep <!--[--><!--]--></a><!----></li><li><a href="/doc/heapdump.html" class="sidebar-item" aria-label="heapdump"><!--[--><!--]--> heapdump <!--[--><!--]--></a><!----></li><li><a href="/doc/help.html" class="sidebar-item" aria-label="help"><!--[--><!--]--> help <!--[--><!--]--></a><!----></li><li><a href="/doc/history.html" class="sidebar-item" aria-label="history"><!--[--><!--]--> history <!--[--><!--]--></a><!----></li><li><a href="/doc/jad.html" class="sidebar-item" aria-label="jad"><!--[--><!--]--> jad <!--[--><!--]--></a><!----></li><li><a href="/doc/jfr.html" class="sidebar-item" aria-label="jfr"><!--[--><!--]--> jfr <!--[--><!--]--></a><!----></li><li><a href="/doc/jvm.html" class="sidebar-item" aria-label="jvm"><!--[--><!--]--> jvm <!--[--><!--]--></a><!----></li><li><a href="/doc/keymap.html" class="sidebar-item" aria-label="keymap"><!--[--><!--]--> keymap <!--[--><!--]--></a><!----></li><li><a href="/doc/logger.html" class="sidebar-item" aria-label="logger"><!--[--><!--]--> logger <!--[--><!--]--></a><!----></li><li><a href="/doc/mbean.html" class="sidebar-item" aria-label="mbean"><!--[--><!--]--> mbean <!--[--><!--]--></a><!----></li><li><a href="/doc/mc.html" class="sidebar-item" aria-label="mc"><!--[--><!--]--> mc <!--[--><!--]--></a><!----></li><li><a href="/doc/memory.html" class="sidebar-item" aria-label="memory"><!--[--><!--]--> memory <!--[--><!--]--></a><!----></li><li><a href="/doc/monitor.html" class="sidebar-item" aria-label="monitor"><!--[--><!--]--> monitor <!--[--><!--]--></a><!----></li><li><a href="/doc/ognl.html" class="sidebar-item" aria-label="ognl"><!--[--><!--]--> ognl <!--[--><!--]--></a><!----></li><li><a href="/doc/options.html" class="sidebar-item" aria-label="options"><!--[--><!--]--> options <!--[--><!--]--></a><!----></li><li><a href="/doc/perfcounter.html" class="sidebar-item" aria-label="perfcounter"><!--[--><!--]--> perfcounter <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/doc/profiler.html" class="router-link-active router-link-exact-active router-link-active sidebar-item active" aria-label="profiler"><!--[--><!--]--> profiler <!--[--><!--]--></a><!----></li><li><a href="/doc/pwd.html" class="sidebar-item" aria-label="pwd"><!--[--><!--]--> pwd <!--[--><!--]--></a><!----></li><li><a href="/doc/quit.html" class="sidebar-item" aria-label="quit"><!--[--><!--]--> quit <!--[--><!--]--></a><!----></li><li><a href="/doc/redefine.html" class="sidebar-item" aria-label="redefine"><!--[--><!--]--> redefine <!--[--><!--]--></a><!----></li><li><a href="/doc/reset.html" class="sidebar-item" aria-label="reset"><!--[--><!--]--> reset <!--[--><!--]--></a><!----></li><li><a href="/doc/retransform.html" class="sidebar-item" aria-label="retransform"><!--[--><!--]--> retransform <!--[--><!--]--></a><!----></li><li><a href="/doc/sc.html" class="sidebar-item" aria-label="sc"><!--[--><!--]--> sc <!--[--><!--]--></a><!----></li><li><a href="/doc/session.html" class="sidebar-item" aria-label="session"><!--[--><!--]--> session <!--[--><!--]--></a><!----></li><li><a href="/doc/sm.html" class="sidebar-item" aria-label="sm"><!--[--><!--]--> sm <!--[--><!--]--></a><!----></li><li><a href="/doc/stack.html" class="sidebar-item" aria-label="stack"><!--[--><!--]--> stack <!--[--><!--]--></a><!----></li><li><a href="/doc/stop.html" class="sidebar-item" aria-label="stop"><!--[--><!--]--> stop <!--[--><!--]--></a><!----></li><li><a href="/doc/sysenv.html" class="sidebar-item" aria-label="sysenv"><!--[--><!--]--> sysenv <!--[--><!--]--></a><!----></li><li><a href="/doc/sysprop.html" class="sidebar-item" aria-label="sysprop"><!--[--><!--]--> sysprop <!--[--><!--]--></a><!----></li><li><a href="/doc/tee.html" class="sidebar-item" aria-label="tee"><!--[--><!--]--> tee <!--[--><!--]--></a><!----></li><li><a href="/doc/thread.html" class="sidebar-item" aria-label="thread"><!--[--><!--]--> thread <!--[--><!--]--></a><!----></li><li><a href="/doc/trace.html" class="sidebar-item" aria-label="trace"><!--[--><!--]--> trace <!--[--><!--]--></a><!----></li><li><a href="/doc/tt.html" class="sidebar-item" aria-label="tt"><!--[--><!--]--> tt <!--[--><!--]--></a><!----></li><li><a href="/doc/version.html" class="sidebar-item" aria-label="version"><!--[--><!--]--> version <!--[--><!--]--></a><!----></li><li><a href="/doc/vmoption.html" class="sidebar-item" aria-label="vmoption"><!--[--><!--]--> vmoption <!--[--><!--]--></a><!----></li><li><a href="/doc/vmtool.html" class="sidebar-item" aria-label="vmtool"><!--[--><!--]--> vmtool <!--[--><!--]--></a><!----></li><li><a href="/doc/watch.html" class="sidebar-item" aria-label="watch"><!--[--><!--]--> watch <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a href="/doc/advanced-use.md" class="sidebar-item collapsible" aria-label="其他特性"><!--[--><!--]--> 其他特性 <!--[--><!--]--></a><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/doc/async.html" class="sidebar-item" aria-label="Arthas 后台异步任务"><!--[--><!--]--> Arthas 后台异步任务 <!--[--><!--]--></a><!----></li><li><a href="/doc/save-log.html" class="sidebar-item" aria-label="执行结果存日志"><!--[--><!--]--> 执行结果存日志 <!--[--><!--]--></a><!----></li><li><a href="/doc/docker.html" class="sidebar-item" aria-label="Docker"><!--[--><!--]--> Docker <!--[--><!--]--></a><!----></li><li><a href="/doc/web-console.html" class="sidebar-item" aria-label="Web Console"><!--[--><!--]--> Web Console <!--[--><!--]--></a><!----></li><li><a href="/doc/tunnel.html" class="sidebar-item" aria-label="Arthas Tunnel"><!--[--><!--]--> Arthas Tunnel <!--[--><!--]--></a><!----></li><li><a href="/doc/idea-plugin.html" class="sidebar-item" aria-label="IDEA Plugin"><!--[--><!--]--> IDEA Plugin <!--[--><!--]--></a><!----></li><li><a href="/doc/arthas-properties.html" class="sidebar-item" aria-label="Arthas Properties"><!--[--><!--]--> Arthas Properties <!--[--><!--]--></a><!----></li><li><a href="/doc/agent.html" class="sidebar-item" aria-label="以 Java Agent 的方式启动"><!--[--><!--]--> 以 Java Agent 的方式启动 <!--[--><!--]--></a><!----></li><li><a href="/doc/spring-boot-starter.html" class="sidebar-item" aria-label="Arthas Spring Boot Starter"><!--[--><!--]--> Arthas Spring Boot Starter <!--[--><!--]--></a><!----></li><li><a href="/doc/http-api.html" class="sidebar-item" aria-label="Http API"><!--[--><!--]--> Http API <!--[--><!--]--></a><!----></li><li><a href="/doc/batch-support.html" class="sidebar-item" aria-label="批处理功能"><!--[--><!--]--> 批处理功能 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a href="/doc/faq.html" class="sidebar-item" aria-label="FAQ"><!--[--><!--]--> FAQ <!--[--><!--]--></a><!----></li><li><p tabindex="0" class="sidebar-item collapsible">专家答疑 <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/doc/expert/intro.html" class="sidebar-item" aria-label="无疑 专家智能答疑 介绍"><!--[--><!--]--> 无疑 专家智能答疑 介绍 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11466.html" class="sidebar-item" aria-label="arthas 有没有在线教程?"><!--[--><!--]--> arthas 有没有在线教程? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12454.html" class="sidebar-item" aria-label="arthas 怎么查看内存情况?"><!--[--><!--]--> arthas 怎么查看内存情况? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13507.html" class="sidebar-item" aria-label="arthas查看内存占用大的地方"><!--[--><!--]--> arthas查看内存占用大的地方 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14832.html" class="sidebar-item" aria-label="arthas启动时内存溢出"><!--[--><!--]--> arthas启动时内存溢出 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15730.html" class="sidebar-item" aria-label="arthas 观察方法中的某个变量的值"><!--[--><!--]--> arthas 观察方法中的某个变量的值 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11440.html" class="sidebar-item" aria-label="arthas 怎么使用?"><!--[--><!--]--> arthas 怎么使用? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11467.html" class="sidebar-item" aria-label="arthas 在线教程在哪?"><!--[--><!--]--> arthas 在线教程在哪? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12455.html" class="sidebar-item" aria-label="arthas 排查内存泄露的具体方法"><!--[--><!--]--> arthas 排查内存泄露的具体方法 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13508.html" class="sidebar-item" aria-label="arthas 如何查看内存使用情况"><!--[--><!--]--> arthas 如何查看内存使用情况 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14833.html" class="sidebar-item" aria-label="Start arthas failed, exception stack trace:com.sun.tools.attach"><!--[--><!--]--> Start arthas failed, exception stack trace:com.sun.tools.attach <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15731.html" class="sidebar-item" aria-label="arthas 过滤方法的阐述"><!--[--><!--]--> arthas 过滤方法的阐述 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11442.html" class="sidebar-item" aria-label="arthas 介绍一下"><!--[--><!--]--> arthas 介绍一下 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11468.html" class="sidebar-item" aria-label="arthas 怎么使用?"><!--[--><!--]--> arthas 怎么使用? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12706.html" class="sidebar-item" aria-label="arthas 火焰图 怎么看?"><!--[--><!--]--> arthas 火焰图 怎么看? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13509.html" class="sidebar-item" aria-label="通过arthas怎样排查项目中哪个对象泄露了或者占用内存太大"><!--[--><!--]--> 通过arthas怎样排查项目中哪个对象泄露了或者占用内存太大 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14834.html" class="sidebar-item" aria-label="使用arthas 跟踪进程服务后,进程所占用的文件描述符陡增,且文件描述符不下降"><!--[--><!--]--> 使用arthas 跟踪进程服务后,进程所占用的文件描述符陡增,且文件描述符不下降 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15735.html" class="sidebar-item" aria-label="arthas报错connect to telnet server error: 127.0.0.1 9999"><!--[--><!--]--> arthas报错connect to telnet server error: 127.0.0.1 9999 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11443.html" class="sidebar-item" aria-label="arthas 下载和安装"><!--[--><!--]--> arthas 下载和安装 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11469.html" class="sidebar-item" aria-label="linux的arthas使用教程"><!--[--><!--]--> linux的arthas使用教程 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12715.html" class="sidebar-item" aria-label="java 如何用arthas 查看 内存 情况?"><!--[--><!--]--> java 如何用arthas 查看 内存 情况? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13510.html" class="sidebar-item" aria-label="查看实时jvm内存大小"><!--[--><!--]--> 查看实时jvm内存大小 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14840.html" class="sidebar-item" aria-label="Unsupported class file major version 61 using arthas 3.6.3"><!--[--><!--]--> Unsupported class file major version 61 using arthas 3.6.3 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15736.html" class="sidebar-item" aria-label="arthas 中jad参数"><!--[--><!--]--> arthas 中jad参数 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11444.html" class="sidebar-item" aria-label="arthas 命令解释"><!--[--><!--]--> arthas 命令解释 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11784.html" class="sidebar-item" aria-label="arthas使用的各类方式有哪些"><!--[--><!--]--> arthas使用的各类方式有哪些 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12716.html" class="sidebar-item" aria-label="arthas 怎么查看堆内存太高"><!--[--><!--]--> arthas 怎么查看堆内存太高 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13511.html" class="sidebar-item" aria-label="arthas方法运行后查看成员变量"><!--[--><!--]--> arthas方法运行后查看成员变量 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14843.html" class="sidebar-item" aria-label="arthas 支持jdk 20么"><!--[--><!--]--> arthas 支持jdk 20么 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15737.html" class="sidebar-item" aria-label="进程停了 arthas也会同步停止么"><!--[--><!--]--> 进程停了 arthas也会同步停止么 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11450.html" class="sidebar-item" aria-label="arthas 分析thread线程卡住"><!--[--><!--]--> arthas 分析thread线程卡住 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11795.html" class="sidebar-item" aria-label="使用arthas查看成员变量值具体怎么做"><!--[--><!--]--> 使用arthas查看成员变量值具体怎么做 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12740.html" class="sidebar-item" aria-label="arthas怎么分析cpu很高"><!--[--><!--]--> arthas怎么分析cpu很高 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13512.html" class="sidebar-item" aria-label="如何查看java内存增长哪些对象"><!--[--><!--]--> 如何查看java内存增长哪些对象 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15167.html" class="sidebar-item" aria-label="介绍一下arthas"><!--[--><!--]--> 介绍一下arthas <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15738.html" class="sidebar-item" aria-label="arthas如何查看hashmap的值"><!--[--><!--]--> arthas如何查看hashmap的值 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11451.html" class="sidebar-item" aria-label="arthas 怎么排查cpu占用过高"><!--[--><!--]--> arthas 怎么排查cpu占用过高 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11809.html" class="sidebar-item" aria-label="linux下的arthas 具体怎么用?(使用教程)"><!--[--><!--]--> linux下的arthas 具体怎么用?(使用教程) <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12741.html" class="sidebar-item" aria-label="如何使用arthas查看系统哪个地方内存占用过大"><!--[--><!--]--> 如何使用arthas查看系统哪个地方内存占用过大 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13513.html" class="sidebar-item" aria-label="arthas 监听成员变量值的方法是什么?"><!--[--><!--]--> arthas 监听成员变量值的方法是什么? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15543.html" class="sidebar-item" aria-label="arthas中tt命令如何查看方法入参的具体命令"><!--[--><!--]--> arthas中tt命令如何查看方法入参的具体命令 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15739.html" class="sidebar-item" aria-label="arthas可以监听私有方法吗"><!--[--><!--]--> arthas可以监听私有方法吗 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11452.html" class="sidebar-item" aria-label="arthas 查看方法耗时"><!--[--><!--]--> arthas 查看方法耗时 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11810.html" class="sidebar-item" aria-label="arthas查看方法耗时"><!--[--><!--]--> arthas查看方法耗时 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13448.html" class="sidebar-item" aria-label="如何使用arthas分析慢查询"><!--[--><!--]--> 如何使用arthas分析慢查询 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13522.html" class="sidebar-item" aria-label="Connect to telnet server error: 127.0.0.1 3658"><!--[--><!--]--> Connect to telnet server error: 127.0.0.1 3658 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15726.html" class="sidebar-item" aria-label="arthas 如何查询static变量"><!--[--><!--]--> arthas 如何查询static变量 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15740.html" class="sidebar-item" aria-label="arthas 分析内存升高的方法"><!--[--><!--]--> arthas 分析内存升高的方法 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11453.html" class="sidebar-item" aria-label="arthas 怎样查看方法耗时"><!--[--><!--]--> arthas 怎样查看方法耗时 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11814.html" class="sidebar-item" aria-label="arthas 怎么排查内存泄漏"><!--[--><!--]--> arthas 怎么排查内存泄漏 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13504.html" class="sidebar-item" aria-label="如何查看实时jvm内存大小占用"><!--[--><!--]--> 如何查看实时jvm内存大小占用 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14763.html" class="sidebar-item" aria-label="利用Arthas排查NoSuchMethodError"><!--[--><!--]--> 利用Arthas排查NoSuchMethodError <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15728.html" class="sidebar-item" aria-label="arthas 获取成员变量"><!--[--><!--]--> arthas 获取成员变量 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history11454.html" class="sidebar-item" aria-label="arthas 常用命令介绍"><!--[--><!--]--> arthas 常用命令介绍 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history12453.html" class="sidebar-item" aria-label="arthas 怎么查看内存情况?"><!--[--><!--]--> arthas 怎么查看内存情况? <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history13506.html" class="sidebar-item" aria-label="如何查看java内存增长哪些对象"><!--[--><!--]--> 如何查看java内存增长哪些对象 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history14831.html" class="sidebar-item" aria-label="Dashboard 命令cpuUsage长期在90%左右"><!--[--><!--]--> Dashboard 命令cpuUsage长期在90%左右 <!--[--><!--]--></a><!----></li><li><a href="/doc/expert/user-question-history15729.html" class="sidebar-item" aria-label="arthas 怎么查看变量内容"><!--[--><!--]--> arthas 怎么查看变量内容 <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><a class="external-link sidebar-item" href="https://github.com/alibaba/arthas/issues?q=label%3Auser-case" rel="noopener noreferrer" target="_blank" aria-label="用户案例"><!--[--><!--]--><span>用户案例</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a><!----></li><li><a class="external-link sidebar-item" href="https://github.com/alibaba/arthas" rel="noopener noreferrer" target="_blank" aria-label="Star me at github"><!--[--><!--]--><span>Star me at github</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a><!----></li><li><a class="external-link sidebar-item" href="https://github.com/alibaba/arthas/blob/master/CONTRIBUTING.md" rel="noopener noreferrer" target="_blank" aria-label="编译调试/参与贡献"><!--[--><!--]--><span>编译调试/参与贡献</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a><!----></li><li><a class="external-link sidebar-item" href="https://github.com/alibaba/arthas/releases" rel="noopener noreferrer" target="_blank" aria-label="Release Notes"><!--[--><!--]--><span>Release Notes</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a><!----></li><li><a href="/doc/contact-us.md" class="sidebar-item" aria-label="QQ 群/钉钉群"><!--[--><!--]--> QQ 群/钉钉群 <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page" data-v-fdd717e0><!--[--><!--]--><div class="right-menu-padding theme-default-content" data-v-fdd717e0><!--[--><!--]--><div class="right-menu-wrapper" data-v-fdd717e0 data-v-64666cd5><div class="right-menu-margin" data-v-64666cd5><div class="right-menu-title" data-v-64666cd5>目录</div><div class="right-menu-content" data-v-64666cd5><!--[--><!--]--></div></div></div><div data-v-fdd717e0><h1 id="profiler" tabindex="-1"><a class="header-anchor" href="#profiler" aria-hidden="true">#</a> profiler</h1><p><a href="https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&amp;id=command-profiler" target="_blank" rel="noopener noreferrer"><code>profiler</code>在线教程<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a></p><div class="custom-container tip"><p class="custom-container-title">提示</p><p>使用<a href="https://github.com/jvm-profiling-tools/async-profiler" target="_blank" rel="noopener noreferrer">async-profiler<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a>生成火焰图</p></div><p><code>profiler</code> 命令支持生成应用热点的火焰图。本质上是通过不断的采样,然后把收集到的采样结果生成火焰图。</p><p><code>profiler</code> 命令基本运行结构是 <code>profiler action [actionArg]</code></p><p><code>profiler</code> 命令的格式基本与上游项目 <a href="https://github.com/async-profiler/async-profiler" target="_blank" rel="noopener noreferrer">async-profiler<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 保持一致,详细的使用方式可参考上游项目的 README、Github Disscussions 以及其他文档资料。</p><h2 id="参数说明" tabindex="-1"><a class="header-anchor" href="#参数说明" aria-hidden="true">#</a> 参数说明</h2><table><thead><tr><th style="text-align:right;">参数名称</th><th style="text-align:left;">参数说明</th></tr></thead><tbody><tr><td style="text-align:right;"><em>action</em></td><td style="text-align:left;">要执行的操作</td></tr><tr><td style="text-align:right;"><em>actionArg</em></td><td style="text-align:left;">属性名模式</td></tr><tr><td style="text-align:right;">[i:]</td><td style="text-align:left;">采样间隔单位ns默认值10&#39;000&#39;000即 10 ms</td></tr><tr><td style="text-align:right;">[f:]</td><td style="text-align:left;">将输出转储到指定路径</td></tr><tr><td style="text-align:right;">[d:]</td><td style="text-align:left;">运行评测指定秒</td></tr><tr><td style="text-align:right;">[e:]</td><td style="text-align:left;">要跟踪哪个事件cpu, alloc, lock, cache-misses 等),默认是 cpu</td></tr></tbody></table><h2 id="启动-profiler" tabindex="-1"><a class="header-anchor" href="#启动-profiler" aria-hidden="true">#</a> 启动 profiler</h2><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ profiler start
Started [cpu] profiling
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">提示</p><p>默认情况下,生成的是 cpu 的火焰图,即 event 为<code>cpu</code>。可以用<code>--event</code>参数指定其他性能分析模式,见下文。</p></div><h2 id="获取已采集的-sample-的数量" tabindex="-1"><a class="header-anchor" href="#获取已采集的-sample-的数量" aria-hidden="true">#</a> 获取已采集的 sample 的数量</h2><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ profiler getSamples
23
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="查看-profiling-状态" tabindex="-1"><a class="header-anchor" href="#查看-profiling-状态" aria-hidden="true">#</a> 查看 profiling 状态</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler status
<span class="token punctuation">[</span>cpu<span class="token punctuation">]</span> profiling is running <span class="token keyword">for</span> <span class="token number">4</span> seconds
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>可以查看当前 profiler 在采样哪种<code>event</code>和采样时间。</p><h2 id="查看-profiler-自身的内存占用" tabindex="-1"><a class="header-anchor" href="#查看-profiler-自身的内存占用" aria-hidden="true">#</a> 查看 profiler 自身的内存占用</h2><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>$ profiler meminfo
Call trace storage: 10244 KB
Dictionaries: 72 KB
Code cache: 12890 KB
------------------------------
Total: 23206 KB
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="停止-profiler" tabindex="-1"><a class="header-anchor" href="#停止-profiler" aria-hidden="true">#</a> 停止 profiler</h2><h3 id="生成火焰图格式结果" tabindex="-1"><a class="header-anchor" href="#生成火焰图格式结果" aria-hidden="true">#</a> 生成火焰图格式结果</h3><p>默认情况下,结果是 <a href="https://github.com/BrendanGregg/FlameGraph" target="_blank" rel="noopener noreferrer">Flame Graph<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 格式的 <code>html</code> 文件,也可以用 <code>-o</code><code>--format</code> 参数指定其他内容格式,包括 flat、traces、collapsed、flamegraph、tree、jfr。</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler stop <span class="token parameter variable">--format</span> flamegraph
profiler output file: /tmp/test/arthas-output/20211207-111550.html
OK
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>--file</code>参数指定的文件名后缀为 <code>html</code><code>jfr</code> 时,文件格式可以被推断出来。比如<code>--file /tmp/result.html</code> 将自动生成火焰图。</p><h2 id="通过浏览器查看-arthas-output-下面的-profiler-结果" tabindex="-1"><a class="header-anchor" href="#通过浏览器查看-arthas-output-下面的-profiler-结果" aria-hidden="true">#</a> 通过浏览器查看 arthas-output 下面的 profiler 结果</h2><p>默认情况下arthas 使用 3658 端口,则可以打开: <a href="http://localhost:3658/arthas-output/" target="_blank" rel="noopener noreferrer">http://localhost:3658/arthas-output/<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 查看到<code>arthas-output</code>目录下面的 profiler 结果:</p><p><img src="/images/arthas-output.jpg" alt=""></p><p>点击可以查看具体的结果:</p><p><img src="/images/arthas-output-svg.jpg" alt=""></p><div class="custom-container tip"><p class="custom-container-title">提示</p><p>如果是 chrome 浏览器,可能需要多次刷新。</p></div><h2 id="profiler-支持的-events" tabindex="-1"><a class="header-anchor" href="#profiler-支持的-events" aria-hidden="true">#</a> profiler 支持的 events</h2><p>在不同的平台,不同的 OS 下面,支持的 events 各有不同。比如在 macos 下面:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler list
Basic events:
cpu
alloc
lock
wall
itimer
ctimer
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>在 linux 下面</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler list
Basic events:
cpu
alloc
lock
wall
itimer
ctimer
Java method calls:
ClassName.methodName
Perf events:
page-faults
context-switches
cycles
instructions
cache-references
cache-misses
branch-instructions
branch-misses
bus-cycles
L1-dcache-load-misses
LLC-load-misses
dTLB-load-misses
rNNN
pmu/event-descriptor/
mem:breakpoint
trace:tracepoint
kprobe:func
uprobe:path
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>如果遇到 OS 本身的权限/配置问题,然后缺少部分 event可以参考 <a href="https://github.com/jvm-profiling-tools/async-profiler" target="_blank" rel="noopener noreferrer">async-profiler 的文档<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a></p><p>可以使用 <code>check</code> action 测试某个 event 是否可用,此 action 的参数格式与 start 一致。</p><p>可以用<code>--event</code>参数指定要采样的事件,比如 <code>alloc</code> 表示分析内存分配情况:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler start <span class="token parameter variable">--event</span> alloc
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="恢复采样" tabindex="-1"><a class="header-anchor" href="#恢复采样" aria-hidden="true">#</a> 恢复采样</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler resume
Started <span class="token punctuation">[</span>cpu<span class="token punctuation">]</span> profiling
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p><code>start</code><code>resume</code>的区别是:<code>start</code>会清除已有的分析结果重新开始,<code>resume</code>则会保留已有的结果,将新的分析结果附加到已有结果中。</p><p>通过执行<code>profiler getSamples</code>可以查看 samples 的数量来验证。</p><h2 id="dump-分析结果" tabindex="-1"><a class="header-anchor" href="#dump-分析结果" aria-hidden="true">#</a> Dump 分析结果</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler dump
OK
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p><code>dump</code> action 将性能分析的结果保存到默认文件或指定的文件中,但 profiling 过程不会停止。例如,如果使用 <code>start</code> action 启动 profiling5 秒后执行 <code>dump</code> action2 秒后再次执行 <code>dump</code> action将会得到 2 个结果文件,第一个文件包括 0~5 秒的分析结果,第二个文件包括 0~7 秒的分析结果。</p><h2 id="使用execute来执行复杂的命令" tabindex="-1"><a class="header-anchor" href="#使用execute来执行复杂的命令" aria-hidden="true">#</a> 使用<code>execute</code>来执行复杂的命令</h2><p>比如开始采样:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler execute <span class="token string">&#39;start,framebuf=5000000&#39;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>停止采样,并保存到指定文件里:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler execute <span class="token string">&#39;stop,file=/tmp/result.html&#39;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>具体的格式参考: <a href="https://github.com/async-profiler/async-profiler/blob/v2.9/src/arguments.cpp#L52" target="_blank" rel="noopener noreferrer">arguments.cpp<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a></p><h2 id="查看所有支持的-action" tabindex="-1"><a class="header-anchor" href="#查看所有支持的-action" aria-hidden="true">#</a> 查看所有支持的 action</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler actions
Supported Actions: <span class="token punctuation">[</span>resume, dumpCollapsed, getSamples, start, list, version, execute, meminfo, stop, load, dumpFlat, dump, actions, dumpTraces, status, check<span class="token punctuation">]</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="查看版本" tabindex="-1"><a class="header-anchor" href="#查看版本" aria-hidden="true">#</a> 查看版本</h2><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ profiler version
Async-profiler <span class="token number">2.9</span> built on May <span class="token number">8</span> <span class="token number">2023</span>
Copyright <span class="token number">2016</span>-2021 Andrei Pangin
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="配置-java-栈深度" tabindex="-1"><a class="header-anchor" href="#配置-java-栈深度" aria-hidden="true">#</a> 配置 Java 栈深度</h2><p>可以使用 <code>-j</code><code>--jstackdepth</code> 选项指定最大 Java 栈深度。如果指定值大于默认值 2048该选项会被忽略。当你不希望看到特别深的栈轨迹的时候这个选项会很有用以下是一个使用样例</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-j</span> <span class="token number">256</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="各线程分别进行-profiling" tabindex="-1"><a class="header-anchor" href="#各线程分别进行-profiling" aria-hidden="true">#</a> 各线程分别进行 profiling</h2><p>可以使用 <code>-t</code><code>--threads</code> 标志选项令 profiling 对各线程分别进行,每个栈轨迹都会以指示单个线程的帧结束。</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-t</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="配置-include-exclude-来过滤数据" tabindex="-1"><a class="header-anchor" href="#配置-include-exclude-来过滤数据" aria-hidden="true">#</a> 配置 include/exclude 来过滤数据</h2><p>如果应用比较复杂,生成的内容很多,想只关注部分 stack traces可以通过 <code>--include/--exclude</code> 过滤 stack traces<code>--include</code> 表示定义的匹配表达式必须出现在 stack traces相反 <code>--exclude</code> 表示定义的匹配表达式一定不会出现在 stack traces。 匹配表达式可以以<code>*</code>开始或者结束,<code>*</code> 表示任何(可能为空)字符序列。 比如</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler stop <span class="token parameter variable">--include</span> <span class="token string">&#39;java/*&#39;</span> <span class="token parameter variable">--include</span> <span class="token string">&#39;com/demo/*&#39;</span> <span class="token parameter variable">--exclude</span> <span class="token string">&#39;*Unsafe.park*&#39;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><blockquote><p><code>--include/--exclude</code> 都支持多次设置,但是需要配置在命令行的最后。也可使用短参数格式 <code>-I/-X</code>。 注意<code>--include/--exclude</code>只支持在<code>stop</code>action或者带有<code>-d</code>/<code>--duration</code>参数的<code>start</code>action中指定否则不生效。</p></blockquote><h2 id="指定执行时间" tabindex="-1"><a class="header-anchor" href="#指定执行时间" aria-hidden="true">#</a> 指定执行时间</h2><p>比如,希望 profiler 执行 300 秒自动结束,可以用 <code>-d</code>/<code>--duration</code> 参数为 collect action 指定时间:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler collect <span class="token parameter variable">--duration</span> <span class="token number">300</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="生成-jfr-格式结果" tabindex="-1"><a class="header-anchor" href="#生成-jfr-格式结果" aria-hidden="true">#</a> 生成 jfr 格式结果</h2><blockquote><p>注意jfr 只支持在 <code>start</code>时配置。如果是在<code>stop</code>时指定,则不会生效。</p></blockquote><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>profiler start --file /tmp/test.jfr
profiler start -o jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p><code>file</code>参数支持一些变量:</p><ul><li>时间戳: <code>--file /tmp/test-%t.jfr</code></li><li>进程 ID <code>--file /tmp/test-%p.jfr</code></li></ul><p>生成的结果可以用支持 jfr 格式的工具来查看。比如:</p><ul><li>JDK Mission Control https://github.com/openjdk/jmc</li><li>JProfiler https://github.com/alibaba/arthas/issues/1416</li></ul><h2 id="控制分析结果的格式" tabindex="-1"><a class="header-anchor" href="#控制分析结果的格式" aria-hidden="true">#</a> 控制分析结果的格式</h2><p>使用 <code>-s</code> 选项将结果中的 Fully qualified name 替换为简单名称,如 <code>demo.MathGame.main</code> 替换为 <code>MathGame.main</code>。使用 <code>-g</code> 选项指定输出方法签名,如 <code>demo.MathGame.main</code> 替换为 <code>demo.MathGame.main([Ljava/lang/String;)V</code>。此外还有许多可调整分析结果格式的选项,可参考 <a href="https://github.com/async-profiler/async-profiler#readme" target="_blank" rel="noopener noreferrer">async-profiler 的 README 文档<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 以及 <a href="https://github.com/async-profiler/async-profiler/discussions" target="_blank" rel="noopener noreferrer">async-profiler 的 Github Discussions<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 等材料。</p><p>例如,以下命令中,<code>-s</code> 将输出中的类名称指定为简短格式,<code>-g</code> 显示方法的完整签名,<code>-a</code> 标注出 Java 方法,<code>-l</code> 为原生方法增加库名称,<code>--title</code> 为生成火焰图页面指定标题,<code>--minwidth</code> 将过滤火焰图中宽度为 15% 以下的帧,<code>--reverse</code> 将火焰图倒置。</p><div class="language-text ext-text line-numbers-mode"><pre class="language-text"><code>profiler stop -s -g -a -l --title &lt;flametitle&gt; --minwidth 15 --reverse
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="生成的火焰图里的-unknown" tabindex="-1"><a class="header-anchor" href="#生成的火焰图里的-unknown" aria-hidden="true">#</a> 生成的火焰图里的 unknown</h2><ul><li>https://github.com/jvm-profiling-tools/async-profiler/discussions/409</li></ul><h2 id="配置-locks-allocations-模式的阈值" tabindex="-1"><a class="header-anchor" href="#配置-locks-allocations-模式的阈值" aria-hidden="true">#</a> 配置 locks/allocations 模式的阈值</h2><p>当使用 lock 或 alloc event 进行 profiling 时,可以使用 <code>--lock</code><code>--alloc</code> 配置阈值,比如下列命令:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-e</span> lock <span class="token parameter variable">--lock</span> 10ms
profiler start <span class="token parameter variable">-e</span> alloc <span class="token parameter variable">--alloc</span> 2m
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>会记录竞争时间超过 10ms 的锁(如果不指定时间单位,则使用 ns 为单位),或者以 2MB 的单位记录对内存的分配。</p><h2 id="配置-jfr-块" tabindex="-1"><a class="header-anchor" href="#配置-jfr-块" aria-hidden="true">#</a> 配置 JFR 块</h2><p>当使用 JFR 作为输出格式时,可以使用 <code>--chunksize</code><code>--chunktime</code> 配置单个 JFR 块的大致容量(以 byte 为单位,默认 100 MB和时间限制默认值为 1 小时),比如:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-f</span> profile.jfr <span class="token parameter variable">--chunksize</span> 100m <span class="token parameter variable">--chunktime</span> 1h
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="将线程按照调度策略分组" tabindex="-1"><a class="header-anchor" href="#将线程按照调度策略分组" aria-hidden="true">#</a> 将线程按照调度策略分组</h2><p>可以使用 <code>--sched</code> 标志选项将输出结果按照 Linux 线程调度策略分组,策略包括 BATCH/IDLE/OTHER。例如</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--sched</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>火焰图的倒数第二行会标记不同的调度策略。</p><h2 id="仅用未销毁对象构建内存分析结果" tabindex="-1"><a class="header-anchor" href="#仅用未销毁对象构建内存分析结果" aria-hidden="true">#</a> 仅用未销毁对象构建内存分析结果</h2><p>使用 <code>--live</code> 标志选项在内存分析结果中仅保留那些在分析过程结束时仍未被 JVM 回收的对象。该选项在排查 Java 堆内存泄露问题时比较有用。</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--live</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="配置收集-c-栈帧的方法" tabindex="-1"><a class="header-anchor" href="#配置收集-c-栈帧的方法" aria-hidden="true">#</a> 配置收集 C 栈帧的方法</h2><p>使用 <code>--cstack MODE</code> 配置收集 native 帧的方法。候选模式有 fp (Frame Pointer), dwarf (DWARF unwind info), lbr (Last Branch Record, 从 Linux 4.1 在 Haswell 可用), and no (不收集 native 栈帧).</p><p>默认情况下C 栈帧会出现在 cpu、itimer、wall-clock、perf-events 模式中,而 Java 级别的 event 比如 alloc 和 lock 只收集 Java stack。</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler <span class="token parameter variable">--cstack</span> fp
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>此命令将收集 native 栈帧的 Frame Pointer 信息。</p><h2 id="当指定-native-函数执行时开始-停止-profiling" tabindex="-1"><a class="header-anchor" href="#当指定-native-函数执行时开始-停止-profiling" aria-hidden="true">#</a> 当指定 Native 函数执行时开始/停止 Profiling</h2><p>使用 <code>--begin function</code><code>--end function</code> 选项,可以在指定的 Native 函数被执行时启动或终止性能分析。主要用途是分析特定的 JVM 阶段,比如 GC 和 Safepoint。需要使用特定 JVM 实现中的 Native 函数名,比如在 HotSpot JVM 中的 SafepointSynchronize::begin 和 SafepointSynchronize::end。</p><h3 id="time-to-safepoint-profiling" tabindex="-1"><a class="header-anchor" href="#time-to-safepoint-profiling" aria-hidden="true">#</a> Time-to-Safepoint Profiling</h3><p>选项 <code>--ttsp</code> 实际上是 <code>--begin SafepointSynchronize::begin --end RuntimeService::record_safepoint_synchronized</code> 的一个别名。它是一种约束而不是独立的事件类型。无论选择哪种事件Profiler 都可以正常工作,但只有在 VM 操作和 Safepoint 请求之间的事件会被记录下来。</p><p>现在,当使用 <code>--ttsp</code> 选项并指定 JFR 输出格式时,<code>profiler</code> 会在生成的 JFR 文件中自动包含 profiler.Window 事件。这些事件表示每次 Time-to-Safepoint 暂停的时间区间,使您无需依赖 JVM 日志即可分析这些暂停。</p><p>示例</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--begin</span> SafepointSynchronize::begin <span class="token parameter variable">--end</span> RuntimeService::record_safepoint_synchronized
profiler start <span class="token parameter variable">--ttsp</span> <span class="token parameter variable">--format</span> jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p>生成的 JFR 文件将包含 profiler.Window 事件,可以使用 JDK Mission Control 等工具查看和分析这些事件。</p><p><strong>注意事项:</strong></p><ul><li><p>profiler.Window 事件是通用的事件,适用于任何使用 --begin 和 --end 触发器的时间窗口,不仅限于 Safepoint 暂停。</p></li><li><p>在分析长时间的 Safepoint 暂停时profiler.Window 事件可帮助您识别造成延迟的原因。</p></li><li><p>当使用 --ttsp 选项时,请确保使用 JFR 输出格式,以便能够生成并查看 profiler.Window 事件。</p></li></ul><h2 id="使用-profiler-记录的-event-生成-jfr-文件" tabindex="-1"><a class="header-anchor" href="#使用-profiler-记录的-event-生成-jfr-文件" aria-hidden="true">#</a> 使用 profiler 记录的 event 生成 JFR 文件</h2><p><code>--jfrsync CONFIG</code> 选项可以指定配置启动 Java Flight Recording输出的 jfr 文件会包含所有常规的 JFR event但采样的来源是由 profiler 提供的。</p><p>CONFIG 参数:</p><ul><li>预置配置CONFIG 可以是 profile表示使用 $JAVA_HOME/lib/jfr 目录下预置的 profile 配置。</li><li>自定义配置文件CONFIG 也可以是自定义的 JFR 配置文件(.jfc此选项的值采用与 jcmd JFR.start 命令的 settings 选项相同的格式。</li><li>指定 JFR 事件列表:现在,可以直接在 --jfrsync 中指定要启用的 JFR 事件列表,而无需创建 .jfc 文件。要指定事件列表,请以 + 开头,多个事件用 + 分隔。</li></ul><p>示例:</p><p>使用预置的 profile 配置启动 JFR</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-e</span> cpu <span class="token parameter variable">--jfrsync</span> profile <span class="token parameter variable">-f</span> combined.jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>直接指定 JFR 事件列表,例如启用 jdk.YoungGarbageCollection 和 jdk.OldGarbageCollection 事件:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-e</span> cpu <span class="token parameter variable">--jfrsync</span> +jdk.YoungGarbageCollection+jdk.OldGarbageCollection <span class="token parameter variable">-f</span> combined.jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><strong>注意事项</strong></p><ul><li>当指定事件列表时,由于逗号 , 用于分隔不同的选项,因此事件之间使用加号 + 分隔。</li><li>如果 --jfrsync 参数不以 + 开头,则被视为预置配置名或 .jfc 配置文件的路径。</li><li>直接指定事件列表在目标应用运行在容器中时特别有用,无需额外的文件操作。</li></ul><h2 id="周期性保存结果" tabindex="-1"><a class="header-anchor" href="#周期性保存结果" aria-hidden="true">#</a> 周期性保存结果</h2><p>使用 <code>--loop TIME</code> 可以持续运行 profiler 并周期性保存结果。选项格式可以是具体时间 hh:mm:ss 或以秒、分钟、小时或天计算的时间间隔。需要确保指定的输出文件名中包含时间戳,否则每次输出的结果都会覆盖上次保存的结果。以下命令持续执行 profiling 并将每个小时内的记录保存到一个 jfr 文件中。</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--loop</span> 1h <span class="token parameter variable">-f</span> /var/log/profile-%t.jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="timeout-选项" tabindex="-1"><a class="header-anchor" href="#timeout-选项" aria-hidden="true">#</a> <code>--timeout</code> 选项</h2><p>这个选项指定 profiling 自动在多久后停止。该选项和 <code>--loop</code> 选项的格式一致,可以是时间点,也可以是一个时间间隔。这两个选项都是用于 <code>start</code> action 而不是 <code>collect</code> action 的。可参考 <a href="https://github.com/async-profiler/async-profiler/discussions/789" target="_blank" rel="noopener noreferrer">async-profiler Github Discussions<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><h2 id="wall-选项" tabindex="-1"><a class="header-anchor" href="#wall-选项" aria-hidden="true">#</a> <code>--wall</code> 选项</h2><p>通过 --wall 选项,可以同时进行 CPU 和 Wall Clock 的性能分析。</p><ol><li>这种联合分析有助于更全面地识别和理解应用程序的性能瓶颈。</li><li>允许用户独立于 CPU 分析设置 Wall Clock 分析的采样间隔。比如,可以通过设置 -e cpu -i 10 --wall 200将 CPU 采样间隔设为 10 毫秒,墙钟采样间隔设为 200 毫秒。</li><li>联合进行 CPU 和 Wall Clock 分析时,输出格式必须设置为 jfr。这一格式支持记录线程的状态信息如 STATE_RUNNABLE 或 STATE_SLEEPING从而区分不同类型的采样事件。</li></ol><p>可参考 <a href="https://github.com/async-profiler/async-profiler/issues/740" target="_blank" rel="noopener noreferrer">async-profiler Github pr#740<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><p>影响:</p><p>Linux 平台: 这个新功能仅在 Linux 平台上有效。macOS 上的 CPU 分析引擎已经基于 Wall clock 模式,因此没有额外的收益。 性能开销: 启用 Wall clock 分析会增加性能开销,因此在同时分析 CPU 和 Wall clock 时,建议增加 Wall clock 的间隔。</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-e</span> cpu <span class="token parameter variable">-i</span> <span class="token number">10</span> <span class="token parameter variable">--wall</span> <span class="token number">100</span> <span class="token parameter variable">-f</span> out.jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="ctimer事件" tabindex="-1"><a class="header-anchor" href="#ctimer事件" aria-hidden="true">#</a> <code>ctimer</code>事件</h2><p><code>ctimer</code> 事件是一种新的 CPU 采样模式,基于 <code>timer_create</code>,提供了无需 <code>perf_events</code> 的精确 CPU 采样。</p><p>在某些情况下,<code>perf_events</code> 可能不可用,例如由于 <code>perf_event_paranoid</code> 设置或 <code>seccomp</code> 限制,或者在容器环境中。虽然 itimer 事件可以在容器中工作,但可能存在采样不准确的问题。</p><p><code>ctimer</code> 事件结合了 <code>cpu</code><code>itimer</code> 的优点:</p><ul><li>高准确性:提供精确的 CPU 采样。</li><li>容器友好:默认在容器中可用。</li><li>低资源消耗:不消耗文件描述符。</li></ul><p><strong>请注意,<code>ctimer</code> 事件目前仅在 <code>Linux</code> 上支持,不支持 <code>macOS</code></strong> 可参考 <a href="https://github.com/async-profiler/async-profiler/issues/855" target="_blank" rel="noopener noreferrer">async-profiler Github Issues<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><p>示例:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-e</span> ctimer <span class="token parameter variable">-o</span> jfr <span class="token parameter variable">-f</span> ./out-test.jfr
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="vtable特性" tabindex="-1"><a class="header-anchor" href="#vtable特性" aria-hidden="true">#</a> <code>vtable</code>特性</h2><p>在某些应用程序中,大量的 CPU 时间花费在调用 <code>megamorphic</code> 的虚方法或接口方法上,这在性能分析中显示为 <code>vtable stub</code><code>itable stub</code>。这无法帮助我们了解特定调用点为何是<code>megamorphic</code> 以及如何优化它。</p><p>vtable 特性可以在<code> vtable stub</code><code>itable stub</code> 之上添加一个伪帧,显示实际调用的对象类型。这有助于清楚地了解在特定调用点,不同接收者的比例。</p><p>该特性默认禁用,可以通过 <code>-F vtable</code> 选项启用(或使用 <code>features=vtable</code>)。 可参考 <a href="https://github.com/async-profiler/async-profiler/issues/736" target="_blank" rel="noopener noreferrer">async-profiler Github Issues<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><p>示例:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-F</span> vtable
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="comptask-特性" tabindex="-1"><a class="header-anchor" href="#comptask-特性" aria-hidden="true">#</a> <code>comptask</code> 特性</h2><p><code>profiler</code> 采样 JIT 编译器线程以及 Java 线程,可以显示 JIT 编译所消耗的 CPU 百分比。然而Java 方法的编译资源消耗各不相同,了解哪些特定的 Java 方法在编译时消耗最多的 CPU 时间非常有用。</p><p><code>comptask</code> 特性可以在 <code>C1/C2</code> 的堆栈跟踪中添加一个虚拟帧,显示当前正在编译的任务,即正在编译的 Java 方法。</p><p>该特性默认禁用,可以通过<code> -F comptask</code> 选项启用(或使用 <code>features=comptask</code>)。 可参考 <a href="https://github.com/async-profiler/async-profiler/issues/777" target="_blank" rel="noopener noreferrer">async-profiler Github Issues<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><p>示例:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">-F</span> comptask
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="配置替代的分析信号" tabindex="-1"><a class="header-anchor" href="#配置替代的分析信号" aria-hidden="true">#</a> 配置替代的分析信号</h2><p><code>profiler</code> 使用 <code>POSIX</code> 信号来进行性能分析。默认情况下,<code>SIGPROF</code> 用于 <code>CPU</code> 分析,<code>SIGVTALRM</code> 用于 <code>Wall-Clock</code> 分析。然而,如果应用程序也使用这些信号,或者希望同时运行多个 <code>profiler</code> 实例,这可能会导致信号冲突。</p><p>现在,可以使用 <code>signal</code> 参数来配置用于分析的信号,以避免冲突。 可参考 <a href="https://github.com/async-profiler/async-profiler/issues/759" target="_blank" rel="noopener noreferrer">async-profiler Github Issues<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><p>语法</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--signal</span> <span class="token operator">&lt;</span>信号号码<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>如果需要分别指定 CPU 和 Wall-Clock 分析的信号,可以使用以下语法:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--signal</span> <span class="token operator">&lt;</span>CPU信号号码<span class="token operator">&gt;</span>/<span class="token operator">&lt;</span>Wall信号号码<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="clock-选项" tabindex="-1"><a class="header-anchor" href="#clock-选项" aria-hidden="true">#</a> <code>--clock</code> 选项</h2><p><code>--clock</code> 选项允许用户控制用于采样时间戳的时钟源。这对于需要将 <code>profiler</code> 的数据与其他工具的数据进行时间戳对齐的场景非常有用。</p><p>用法</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--clock</span> <span class="token operator">&lt;</span>tsc<span class="token operator">|</span>monotonic<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>参数</p><ul><li><code>tsc</code>:使用 CPU 的时间戳计数器(<code>RDTSC</code>)。这是默认选项,提供高精度的时间戳。</li><li><code>monotonic</code>:使用操作系统的单调时钟(<code>CLOCK_MONOTONIC</code>)。这有助于在多种数据源之间对齐时间戳。 可参考 <a href="https://github.com/async-profiler/async-profiler/issues/723" target="_blank" rel="noopener noreferrer">async-profiler Github Issues<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</li></ul><p>示例 :</p><p>使用 <code>CLOCK_MONOTONIC</code> 作为时间戳源:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--clock</span> monotonic
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><strong>注意事项:</strong></p><ul><li>当需要将 <code>profiler</code> 的数据与其他使用 <code>CLOCK_MONOTONIC</code> 的工具(例如 <code>perf</code>)的数据进行对齐时,使用 <code>--clock monotonic</code></li><li>在使用 <code>jfrsync</code> 模式时,请谨慎使用 <code>--clock</code> 选项,因为 JVM 和 <code>profiler</code> 可能使用不同的时间戳源,这可能导致结果不一致。</li></ul><h2 id="norm-选项" tabindex="-1"><a class="header-anchor" href="#norm-选项" aria-hidden="true">#</a> <code>--norm</code> 选项</h2><p>在 Java 20 及更早的版本中,编译器为 <code>lambda</code> 表达式生成的方法名称包含唯一的数字后缀。例如,同一代码位置定义的 <code>lambda</code> 表达式,可能会生成多个不同的帧名称,因为每个 <code>lambda</code> 方法的名称都会附加一个唯一的数字后缀(如 <code>lambda$method$0</code><code>lambda$method$1</code> 等)。这会导致逻辑上相同的堆栈无法在火焰图中合并,增加了性能分析的复杂性。</p><p>为了解决这个问题,<code>profiler</code> 新增了 <code>--norm</code> 选项,可以在生成输出时自动规范化方法名称,去除这些数字后缀,使相同的堆栈能够正确地合并。 可参考 <a href="https://github.com/async-profiler/async-profiler/issues/832" target="_blank" rel="noopener noreferrer">async-profiler Github Issues<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span></a> 了解更多信息。</p><p><strong>示例:</strong></p><p>生成规范化的火焰图:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>profiler start <span class="token parameter variable">--norm</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></div><!--[--><!--]--></div><footer class="page-meta right-menu-padding" data-v-fdd717e0><div class="meta-item edit-link"><a class="external-link meta-item-label" href="https://github.com/alibaba/arthas/edit/master/site/docs/doc/profiler.md" rel="noopener noreferrer" target="_blank" aria-label="在 GitHub 上编辑此页"><!--[--><!--]--><span>在 GitHub 上编辑此页</span><span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">在新窗口打开</span></span><!--[--><!--]--></a></div><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">贡献者: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: wenchenghuang@mail.bnu.edu.cn">Winson Huang</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: hengyunabc@gmail.com">hengyunabc</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: hengyunabc@users.noreply.github.com">hengyunabc</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: 18235787078@163.com">CrazyCoder</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: 68638598+Allan-QLB@users.noreply.github.com">Allan-QLB</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: i@fatpandac.com">Fatpandac</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: 983433479@qq.com">汪吉</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: hollowman186@vip.qq.com">Hollow Man</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav right-menu-padding" data-v-fdd717e0><p class="inner"><span class="prev"><a href="/doc/perfcounter.html" class="" aria-label="perfcounter"><!--[--><!--]--> perfcounter <!--[--><!--]--></a></span><span class="next"><a href="/doc/pwd.html" class="" aria-label="pwd"><!--[--><!--]--> pwd <!--[--><!--]--></a></span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script type="module" src="/assets/app.5024572d.js" defer></script>
</body>
</html>