add heapdump command doc. close #837

This commit is contained in:
hengyunabc
2019-09-03 16:46:52 +08:00
parent 58e77dc6f3
commit c2a2fbcd39
5 changed files with 71 additions and 1 deletions
@@ -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;
}
+1
View File
@@ -15,6 +15,7 @@
* [sc](sc.md)
* [sm](sm.md)
* [dump](dump.md)
* [heapdump](heapdump.md)
* [jad](jad.md)
* [classloader](classloader.md)
+1
View File
@@ -15,6 +15,7 @@ All Commands
* [sc](sc.md)
* [sm](sm.md)
* [dump](dump.md)
* [heapdump](heapdump.md)
* [jad](jad.md)
* [classloader](classloader.md)
+34
View File
@@ -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
```
+34
View File
@@ -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
```