From c2a2fbcd39da44d08f2c797d632e175202bbb451 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Tue, 3 Sep 2019 16:46:52 +0800 Subject: [PATCH] add heapdump command doc. close #837 --- .../command/monitor200/HeapDumpCommand.java | 2 +- site/src/site/sphinx/commands.md | 1 + site/src/site/sphinx/en/commands.md | 1 + site/src/site/sphinx/en/heapdump.md | 34 +++++++++++++++++++ site/src/site/sphinx/heapdump.md | 34 +++++++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 site/src/site/sphinx/en/heapdump.md create mode 100644 site/src/site/sphinx/heapdump.md diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/HeapDumpCommand.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/HeapDumpCommand.java index 9b1b7580e..39d07d88b 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/HeapDumpCommand.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/HeapDumpCommand.java @@ -41,7 +41,7 @@ public class HeapDumpCommand extends AnnotatedCommand { } @Option(shortName = "l", longName = "live", flag = true) - @Description("Only dump live objects, default value true") + @Description("Dump only live objects; if not specified, all objects in the heap are dumped.") public void setLive(boolean live) { this.live = live; } diff --git a/site/src/site/sphinx/commands.md b/site/src/site/sphinx/commands.md index 12c706ee3..60ea9ed9a 100644 --- a/site/src/site/sphinx/commands.md +++ b/site/src/site/sphinx/commands.md @@ -15,6 +15,7 @@ * [sc](sc.md) * [sm](sm.md) * [dump](dump.md) +* [heapdump](heapdump.md) * [jad](jad.md) * [classloader](classloader.md) diff --git a/site/src/site/sphinx/en/commands.md b/site/src/site/sphinx/en/commands.md index fa2e5cdc2..44491fe4f 100644 --- a/site/src/site/sphinx/en/commands.md +++ b/site/src/site/sphinx/en/commands.md @@ -15,6 +15,7 @@ All Commands * [sc](sc.md) * [sm](sm.md) * [dump](dump.md) +* [heapdump](heapdump.md) * [jad](jad.md) * [classloader](classloader.md) diff --git a/site/src/site/sphinx/en/heapdump.md b/site/src/site/sphinx/en/heapdump.md new file mode 100644 index 000000000..d63809972 --- /dev/null +++ b/site/src/site/sphinx/en/heapdump.md @@ -0,0 +1,34 @@ +heapdump +=== + +> dump java heap in hprof binary format, like `jmap`. + + +### Usage + +#### Dump to file + +```bash +[arthas@58205]$ heapdump /tmp/dump.hprof +Dumping heap to /tmp/dump.hprof... +Heap dump file created +``` + +#### Dump only live objects + +```bash +[arthas@58205]$ heapdump --live /tmp/dump.hprof +Dumping heap to /tmp/dump.hprof... +Heap dump file created +``` + +#### Dump to tmp file + +```bash +[arthas@58205]$ heapdump +Dumping heap to /var/folders/my/wy7c9w9j5732xbkcyt1mb4g40000gp/T/heapdump2019-09-03-16-385121018449645518991.hprof... +Heap dump file created +``` + + + diff --git a/site/src/site/sphinx/heapdump.md b/site/src/site/sphinx/heapdump.md new file mode 100644 index 000000000..dea922a04 --- /dev/null +++ b/site/src/site/sphinx/heapdump.md @@ -0,0 +1,34 @@ +heapdump +=== + +> dump java heap, 类似jmap命令的heap dump功能。 + + +### 使用参考 + +#### dump到指定文件 + +```bash +[arthas@58205]$ heapdump /tmp/dump.hprof +Dumping heap to /tmp/dump.hprof... +Heap dump file created +``` + +#### 只dump live对象 + +```bash +[arthas@58205]$ heapdump --live /tmp/dump.hprof +Dumping heap to /tmp/dump.hprof... +Heap dump file created +``` + +### dump到临时文件 + +```bash +[arthas@58205]$ heapdump +Dumping heap to /var/folders/my/wy7c9w9j5732xbkcyt1mb4g40000gp/T/heapdump2019-09-03-16-385121018449645518991.hprof... +Heap dump file created +``` + + +