Skip to content

Commit c26d5b3

Browse files
committed
更新
1 parent fc2e0ff commit c26d5b3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

MD/OOM-analysis.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Java 堆内存溢出
44

55
在 Java 堆中只要不断的创建对象,并且 `GC-Roots` 到对象之间存在引用链,这样 `JVM` 就不会回收对象。
6+
67
只要将`-Xms(最下堆)`,`-Xmx(最大堆)` 设置为一样禁止自动扩展堆内存。
78
当使用一个 `while(true)` 循环来不断创建对象就会发生 `OutOfMemory`,还可以使用 `-XX:+HeapDumpOutofMemoryErorr` 当发生 OOM 时会自动 dump 堆栈到文件中。
89

0 commit comments

Comments
 (0)