38 Star 245 Fork 64

唯品会 / VJTools

加入 Gitee
与超过 600 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README_EN.md 1.62 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史

VJDump

VJDump comes as a handy script for collecting diagnostic data for JVM during urgent failures to allow for complete analysis later.

1.Introduction

When major system failures occur for reasons not yet known, rebooting may be the only option to ease user complaints. There is so little time that even an experienced system admin might forget to pick up all he needs for offline analysis.

VJDump script is written to make us eaiser, which just packs outputs from T jstack, jmap, gc logs into the form of a single zip file under /tmp/vjtools/vjdump.

[Important]: Commands like jstack and jmap DO cause stop-of-the-world of the target app. Make sure the target app is isolated from user access before you run this full check in production.

Items to be collected by VJDump are:

  • thread dump via jstack -l $PID
  • vjtop JVM overview and busy threads snapshot via vjtop.sh -n 1 -d 3 $PID (enabled when you have our vjtop installed and have the folder of vjtop.sh appended to the PATH environment variable)
  • jmap histo object statistics viajmap -histo $PID & jmap -histo:live $PID
  • GC logs if available
  • heap dump (which can be optionally switched on via --liveheap):jmap -dump:live,format=b,file=${DUMP_FILE} $PID

2. Download

vjdump.sh

3. Getting Started

Use the following commands under the same user who started the target process and collect results in /tmp/vjtools/vjdump.


# collect dignostics for target $pid
vjdump.sh $pid


# include heap dump also via jmap -dump:live, might take longer
vjdump.sh --liveheap $pid

评论 ( 0 )

你可以在登录后,发表评论

Java
1
https://gitee.com/vipshop/VJTools.git
git@gitee.com:vipshop/VJTools.git
vipshop
VJTools
VJTools
master

搜索帮助