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/en/doc/getstatic.html

75 lines
62 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.49">
<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 - Fatpandac/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 - Fatpandac/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 - Fatpandac/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><title>getstatic | arthas</title><meta name="description" content="arthas user document">
3 years ago
<link rel="modulepreload" href="/assets/app.8a3762b8.js"><link rel="modulepreload" href="/assets/getstatic.html.10d848c9.js"><link rel="modulepreload" href="/assets/getstatic.html.7b756fa0.js"><link rel="prefetch" href="/assets/index.html.45b69b3a.js"><link rel="prefetch" href="/assets/index.html.76ea9ae7.js"><link rel="prefetch" href="/assets/index.html.1eea359b.js"><link rel="prefetch" href="/assets/advanced-use.html.10269055.js"><link rel="prefetch" href="/assets/advice-class.html.36067001.js"><link rel="prefetch" href="/assets/agent.html.9015da1d.js"><link rel="prefetch" href="/assets/arthas-properties.html.cee1ed6b.js"><link rel="prefetch" href="/assets/arthas3.html.acc26c6e.js"><link rel="prefetch" href="/assets/async.html.e27f256b.js"><link rel="prefetch" href="/assets/auth.html.32218e6b.js"><link rel="prefetch" href="/assets/base64.html.4047e29e.js"><link rel="prefetch" href="/assets/batch-support.html.7ecb82c6.js"><link rel="prefetch" href="/assets/cat.html.cc30c619.js"><link rel="prefetch" href="/assets/classloader.html.6c401b19.js"><link rel="prefetch" href="/assets/cls.html.5a559768.js"><link rel="prefetch" href="/assets/commands.html.258e29be.js"><link rel="prefetch" href="/assets/contact-us.html.421393eb.js"><link rel="prefetch" href="/assets/dashboard.html.4eb977c5.js"><link rel="prefetch" href="/assets/docker.html.811af1aa.js"><link rel="prefetch" href="/assets/download.html.54eca683.js"><link rel="prefetch" href="/assets/dump.html.cecedbdc.js"><link rel="prefetch" href="/assets/echo.html.046fded9.js"><link rel="prefetch" href="/assets/faq.html.69db73f0.js"><link rel="prefetch" href="/assets/getstatic.html.8b8918aa.js"><link rel="prefetch" href="/assets/grep.html.9589e767.js"><link rel="prefetch" href="/assets/groovy.html.a7b151ba.js"><link rel="prefetch" href="/assets/heapdump.html.3779c034.js"><link rel="prefetch" href="/assets/help.html.1ee751af.js"><link rel="prefetch" href="/assets/history.html.6d544ac4.js"><link rel="prefetch" href="/assets/http-api.html.1ee2ca01.js"><link rel="prefetch" href="/assets/idea-plugin.html.3d23f092.js"><link rel="prefetch" href="/assets/install-detail.html.e60cda0e.js"><link rel="prefetch" href="/assets/jad.html.7cc2f9ab.js"><link rel="prefetch" href="/assets/jvm.html.99f686c2.js"><link rel="prefetch" href="/assets/keymap.html.152983ec.js"><link rel="prefetch" href="/assets/logger.html.37652f5a.js"><link rel="prefetch" href="/assets/manual-install.html.ec6f137a.js"><link rel="prefetch" href="/assets/mbean.html.dd61851f.js"><link rel="prefetch" href="/assets/mc.html.4ad9c4ed.js"><link rel="prefetch" href="/assets/memory.html.987bdeb1.js"><link rel="prefetch" href="/assets/monitor.html.39213eeb.js"><link rel="prefetch" href="/assets/ognl.html.94fd12b2.js"><link rel="prefetch" href="/assets/options.html.ff8fe789.js"><link rel="prefetch" href="/assets/perfcounter.html.4ad1dec5.js"><link rel="prefetch" href="/assets/profiler.html.235e7cd3.js"><link rel="prefetch" href="/assets/pwd.html.31c88e07.js"><link rel="prefetch" href="/assets/quick-start.html.ecd924ae.js"><link rel="prefetch" href="/assets/quit.html.f082ff2d.js"><link rel="prefetch" href="/assets/redefine.html.9dc81560.js"><link rel="prefetch" href="/assets/release-notes.html.ceeefd88.js"><link rel="prefetch" href="/assets/reset.html.fb7a3c31.js"><link rel="prefetch" href="/assets/retransform.html.c3f8c24d.js"><link rel="prefetch" href="/assets/save-log.html.b8840842.js"><link rel="prefetch" href="/assets/sc.html.46898c95.js"><link rel="prefetch" href="/assets/session.html.e39a5ae5.js"><link rel="prefetch" href="/assets/sm.html.3335d118.js"><link rel="prefetch" href="/assets/spring-boot-starter.html.15a438ba.js"><link rel="prefetch" href="/assets/stack.html.6cf13a4b.js"><link rel="prefetch" href="/assets/start-arthas.html.073b53b8.js"><link rel="prefetch" href="/assets/stop.html.4353502b.js"><link rel="prefetch" href="/assets/sysenv.html.b3de9636.js"><link rel="prefetch" href="/assets/sysprop.html.bad87bbb.js"><link rel="prefetch" href="/assets/tee.html.1dcb7a40.js"><link rel="prefetch" href="/assets/thread.html.1
<link rel="stylesheet" href="/assets/style.eaa9a6b4.css">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/en/" class=""><!----><span class="site-name can-hide">arthas</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><a href="/en/" class="" aria-label="HOME"><!--[--><!--]--> HOME <!--[--><!--]--></a></div><div class="navbar-item"><a class="external-link" href="/doc/arthas-tutorials.html?language=en&amp;id=arthas-basics" rel="noopener noreferrer" target="_blank" aria-label="ONLINE TUTORIALS"><!--[--><!--]--><span>ONLINE TUTORIALS</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">open in new window</span></span><!--[--><!--]--></a></div><div class="navbar-item"><a href="/en/doc" class="router-link-active" aria-label="DOCS"><!--[--><!--]--> DOCS <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="SOLUTIONS"><span class="title">SOLUTIONS</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="SOLUTIONS"><span class="title">SOLUTIONS</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://cn.aliyun.com/product/aliware/mse?spm=arthas.topbar.0.0.0" rel="noopener noreferrer" target="_blank" aria-label="Microservice solutions"><!--[--><!--]--><span>Microservice solutions</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">open in new window</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="https://www.aliyun.com/aliware/txc?spm=arthas.topbar.0.0.0" rel="noopener noreferrer" target="_blank" aria-label="Distributed transaction solutions"><!--[--><!--]--><span>Distributed transaction solutions</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">open in new window</span></span><!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a class="external-link" href="https://www.aliyun.com/product/ahas?spm=arthas.topbar.0.0.0" rel="noopener noreferrer" target="_blank" aria-label="High-availability solution"><!--[--><!--]--><span>High-availability solution</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="M1
field: random
@Random<span class="token punctuation">[</span>
<span class="token assign-left variable">serialVersionUID</span><span class="token operator">=</span>@Long<span class="token punctuation">[</span><span class="token number">3905348978240129619</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">seed</span><span class="token operator">=</span>@AtomicLong<span class="token punctuation">[</span><span class="token number">120955813885284</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">multiplier</span><span class="token operator">=</span>@Long<span class="token punctuation">[</span><span class="token number">25214903917</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">addend</span><span class="token operator">=</span>@Long<span class="token punctuation">[</span><span class="token number">11</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">mask</span><span class="token operator">=</span>@Long<span class="token punctuation">[</span><span class="token number">281474976710655</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">DOUBLE_UNIT</span><span class="token operator">=</span>@Double<span class="token punctuation">[</span><span class="token number">1</span>.1102230246251565E-16<span class="token punctuation">]</span>,
<span class="token assign-left variable">BadBound</span><span class="token operator">=</span>@String<span class="token punctuation">[</span>bound must be positive<span class="token punctuation">]</span>,
<span class="token assign-left variable">BadRange</span><span class="token operator">=</span>@String<span class="token punctuation">[</span>bound must be greater than origin<span class="token punctuation">]</span>,
<span class="token assign-left variable">BadSize</span><span class="token operator">=</span>@String<span class="token punctuation">[</span>size must be non-negative<span class="token punctuation">]</span>,
<span class="token assign-left variable">seedUniquifier</span><span class="token operator">=</span>@AtomicLong<span class="token punctuation">[</span>-3282039941672302964<span class="token punctuation">]</span>,
<span class="token assign-left variable">nextNextGaussian</span><span class="token operator">=</span>@Double<span class="token punctuation">[</span><span class="token number">0.0</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">haveNextNextGaussian</span><span class="token operator">=</span>@Boolean<span class="token punctuation">[</span>false<span class="token punctuation">]</span>,
<span class="token assign-left variable">serialPersistentFields</span><span class="token operator">=</span>@ObjectStreamField<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span>isEmpty<span class="token operator">=</span>false<span class="token punctuation">;</span><span class="token assign-left variable">size</span><span class="token operator">=</span><span class="token number">3</span><span class="token punctuation">]</span>,
<span class="token assign-left variable">unsafe</span><span class="token operator">=</span>@Unsafe<span class="token punctuation">[</span>sun.misc.Unsafe@2eaa1027<span class="token punctuation">]</span>,
<span class="token assign-left variable">seedOffset</span><span class="token operator">=</span>@Long<span class="token punctuation">[</span><span class="token number">24</span><span class="token punctuation">]</span>,
<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 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><ul><li>Specify classLoader</li></ul><p>Note that the hashcode changes, you need to check the current ClassLoader information first, and extract the hashcode corresponding to the ClassLoader using <code>sc -d &lt;ClassName&gt;</code>.</p><p>if you use<code>-c</code>, you have to manually type hashcode by <code>-c &lt;hashcode&gt;</code>.</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ getstatic -c 3d4eac69 demo.MathGame random
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>For classloader with only one instance, it can be specified by <code>--classLoaderClass</code> using class name, which is more convenient to use.</p><p><code>getstatic --classLoaderClass demo.MathGame random</code></p><ul><li>PS: Here the classLoaderClass in java 8 is sun.misc.Launcher$AppClassLoader, while in java 11 it&#39;s jdk.internal.loader.ClassLoaders$AppClassLoader. Currently katacoda using java 8.</li></ul><p>The value of <code>--classloaderclass</code> is the class name of classloader. It can only work when it matches a unique classloader instance. The purpose is to facilitate the input of general commands. However, <code>-c &lt;hashcode&gt;</code> is dynamic.</p><p>Tip: if the static field is a complex class, you can even use <a href="https://commons.apache.org/proper/commons-ognl/language-guide.html" target="_blank" rel="noopener noreferrer"><code>OGNL</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">open in new window</span></span></a> to traverse, filter and access the inner properties of this class.</p><ul><li><a href="https://commons.apache.org/proper/commons-ognl/language-guide.html" target="_blank" rel="noopener noreferrer">OGNL official guide<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">open in new window</span></span></a></li><li><a href="https://github.com/alibaba/arthas/issues/71" target="_blank" rel="noopener noreferrer">Special usages<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">open in new window</span></span></a></li></ul><p>E.g. suppose <code>n</code> is a <code>Map</code> and its key is a <code>Enum</code>, then you can achieve this if you want to pick the key with a specific <code>Enum</code> value:</p><div class="language-bash ext-sh line-numbers-mode"><pre class="language-bash"><code>$ getstatic com.alibaba.arthas.Test n <span class="token string">&#39;entrySet().iterator.{? #this.key.name()==&quot;STOP&quot;}&#39;</span>
field: n
@ArrayList<span class="token punctuation">[</span>
@Node<span class="token punctuation">[</span>STOP<span class="token operator">=</span>bbb<span class="token punctuation">]</span>,
<span class="token punctuation">]</span>
Affect<span class="token punctuation">(</span>row-cnt:1<span class="token punctuation">)</span> cost <span class="token keyword">in</span> <span class="token number">68</span> ms.
$ getstatic com.alibaba.arthas.Test m <span class="token string">&#39;entrySet().iterator.{? #this.key==&quot;a&quot;}&#39;</span>
field: m
@ArrayList<span class="token punctuation">[</span>
@Node<span class="token punctuation">[</span>a<span class="token operator">=</span>aaa<span class="token punctuation">]</span>,
<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 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></div><!--[--><!--]--></div><footer class="page-meta" data-v-e0e60120><div class="meta-item edit-link"><a class="external-link meta-item-label" href="https://github.com/alibaba/arthas/edit/master/site/docs/en/doc/getstatic.md" rel="noopener noreferrer" target="_blank" aria-label="Edit this page on GitHub"><!--[--><!--]--><span>Edit this page on 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">open in new window</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">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: hengyunabc@gmail.com">hengyunabc</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: arteevraina@gmail.com">Arteev Raina</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: LHearen@126.com">Hearen</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: hollowman186@vip.qq.com">Hollow Man</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: hollowman@hollowman.ml">Hollow Man</span><!--[-->, <!--]--><!--]--><!--[--><span class="contributor" title="email: ian.luo@gmail.com">beiwei30</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
3 years ago
<script type="module" src="/assets/app.8a3762b8.js" defer></script>
</body>
</html>