</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div></div></div><divclass="custom-container tip"><pclass="custom-container-title">TIP</p><p>Through the <code>--limit</code> parameter, you can limit the number of return values to avoid pressure on the JVM when obtaining large data. The default value of limit is 10.</p></div><h3id="specify-classloader-name"tabindex="-1"><aclass="header-anchor"href="#specify-classloader-name"aria-hidden="true">#</a> Specify classloader name</h3><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="specify-classloader-hash"tabindex="-1"><aclass="header-anchor"href="#specify-classloader-hash"aria-hidden="true">#</a> Specify classloader hash</h3><p>The classloader that loads the class can be found through the <code>sc</code> command.</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>$ sc -d org.springframework.context.ApplicationContext
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div><divclass="line-number"></div></div></div><p>Then use the <code>-c</code>/<code>--classloader</code> parameter to specify:</p><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>vmtool --action getInstances -c 19469ea2 --className org.springframework.context.ApplicationContext
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="specify-the-number-of-expanded-layers-of-returned-results"tabindex="-1"><aclass="header-anchor"href="#specify-the-number-of-expanded-layers-of-returned-results"aria-hidden="true">#</a> Specify the number of expanded layers of returned results</h3><divclass="custom-container tip"><pclass="custom-container-title">TIP</p><p>The return result of the <code>getInstances</code> action is bound to the <code>instances</code> variable, which is an array.</p><p>The expansion level of the result can be specified by the <code>-x</code>/<code>--expand</code> parameter, the default value is 1.</p></div><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>vmtool --action getInstances -c 19469ea2 --className org.springframework.context.ApplicationContext -x <spanclass="token number">2</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="execute-expression"tabindex="-1"><aclass="header-anchor"href="#execute-expression"aria-hidden="true">#</a> Execute expression</h3><divclass="custom-container tip"><pclass="custom-container-title">TIP</p><p>The return result of the <code>getInstances</code> action is bound to the <code>instances</code> variable, which is an array. The specified expression can be executed through the <code>--express</code> parameter.</p></div><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext --express<spanclass="token string">'instances[0].getBeanDefinitionNames()'</span>
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><h3id="force-gc"tabindex="-1"><aclass="header-anchor"href="#force-gc"aria-hidden="true">#</a> Force GC</h3><divclass="language-bash ext-sh line-numbers-mode"><preclass="language-bash"><code>vmtool --action forceGc
</code></pre><divclass="line-numbers"aria-hidden="true"><divclass="line-number"></div></div></div><ul><li>Use the <ahref="/en/doc/vmoption.html"class=""><code>vmoption</code></a> command to dynamically turn on the <code>PrintGC</code> option.</li></ul></div><!--[--><!--]--></div><footerclass="page-meta right-menu-padding"data-v-e0e60120><divclass="meta-item edit-link"><aclass="external-link meta-item-label"href="https://github.com/alibaba/arthas/edit/master/site/docs/en/doc/vmtool.md"rel="noopener noreferrer"target="_blank"aria-label="Edit this page on GitHub"><!--[--><!--]--><span>Edit this page on GitHub</span><span><svgclass="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"><pathfill="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><polygonfill="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><spanclass="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><divclass="meta-item last-updated"><spanclass="meta-item-label">Last Updated: </span><!----></div><divclass="meta-item contributors"><spanclass="meta-item-label">Contributors: </span><spanclass="meta-item-info"><!--[--><!--[--><spanclass="contributor"title="email: hengyunabc@gmail.com">hengyunabc</span><!----><!--]--><!--]--></span></div></footer><!----><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>