We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 275d5ea commit fc2e0ffCopy full SHA for fc2e0ff
MD/OOM-analysis.md
@@ -2,7 +2,8 @@
2
3
## Java 堆内存溢出
4
5
-在 Java 堆中只要不断的创建对象,并且 `GC-Roots` 到对象之间存在引用链,这样 `JVM` 就不会回收对象。只要将`-Xms(最下堆)`,`-Xmx(最大堆)` 设置为一样禁止自动扩展堆内存。
+在 Java 堆中只要不断的创建对象,并且 `GC-Roots` 到对象之间存在引用链,这样 `JVM` 就不会回收对象。
6
+只要将`-Xms(最下堆)`,`-Xmx(最大堆)` 设置为一样禁止自动扩展堆内存。
7
当使用一个 `while(true)` 循环来不断创建对象就会发生 `OutOfMemory`,还可以使用 `-XX:+HeapDumpOutofMemoryErorr` 当发生 OOM 时会自动 dump 堆栈到文件中。
8
9
伪代码:
0 commit comments