arthas 查看变量值的几种方式

很多时候我们包含了一些变量,需要check 变量的值,arthas 提供了几种方法

通过ognl

ognl 是一个强大的功能,可以看一些变量信息,比如静态类,静态字段的

  • 参考使用
ognl '@java.lang.System@out.println("hello")'

通过vmtool

vmtool 利用了JVMTI 接口,比ognl 更加强大,同时也支持与ognl 结合起来一起使用

  • 参考使用
vmtool --action getInstances --className com.dremio.dac.server.DACConfig  --express 'instances[0].allowTestApis' 

说明

使用好arthas,解决一些问题很方便

参考资料

https://arthas.aliyun.com/doc/ognl.html#%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E
https://arthas.aliyun.com/doc/vmtool.html

posted on   荣锋亮  阅读(2386)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2022-01-16 image-combiner 方便的图片合成包
2022-01-16 使用graalvm native-image 快速暴露jar 代码为native 共享库
2021-01-16 xk6 构建原理说明
2020-01-16 mupdf pdf文档转换工具源码构建安装

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示