-XX:+HeapDumpOnOutOfMemoryError

1.这个jvm启动参数含义:当堆内存空间溢出时输出堆的内存快照。

2.配合参数: -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/export/home/tomcat/logs/...

3、触发条件:java.lang.OutOfMemo-ryError: Java heap space

也就是说当发生OutOfMemoryError错误时,才能触发-XX:HeapDumpOnOutOfMemoryError 输出到-XX:HeapDumpPath指定位置。

4.关于fullgc:所以Systerm.gc() 以及fullgc 不会触发-XX:HeapDumpOnOutOfMemoryError

原文地址:https://www.cnblogs.com/zouhong/p/13258037.html