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/tutorials/katacoda/command-vmtool-cn/vmtool-classloader.md

32 lines
1.1 KiB
Markdown

### 指定 classloader name
`vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className org.springframework.context.ApplicationContext`{{execute T2}}
### 指定 classloader hash
可以通过`sc`命令查找到加载class的 classloader。
```bash
$ sc -d org.springframework.context.ApplicationContext
class-info org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext
code-source file:/private/tmp/demo-arthas-spring-boot.jar!/BOOT-INF/lib/spring-boot-1.5.13.RELEASE.jar!/
name org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext
...
class-loader +-org.springframework.boot.loader.LaunchedURLClassLoader@19469ea2
+-sun.misc.Launcher$AppClassLoader@75b84c92
+-sun.misc.Launcher$ExtClassLoader@4f023edb
classLoaderHash 19469ea2
```
然后用`-c`/`--classloader` 参数指定:
```bash
vmtool --action getInstances -c 19469ea2 --className org.springframework.context.ApplicationContext
```