Java OOM Error
OOM(OutOfMemoryError)是java工程师都会了解的一种异常,实质上,OOM并不是只有一种,一共有9种不同类型的OOM:
- java.lang.OutOfMemoryError: Java heap space
- java.lang.OutOfMemoryError: GC Overhead limit exceeded
- java.lang.OutOfMemoryError: Permgen space
- java.lang.OutOfMemoryError: Metaspace
- java.lang.OutOfMemoryError: Unable to create new native thread
- java.lang.OutOfMemoryError: reason stack_trace_with_native_method
- java.lang.OutOfMemoryError: Requested array size exceeds VM limit
- java.lang.OutOfMemoryError: Kill process or sacrifice child
- java.lang.OutOfMemoryError: Direct buffer memory
不同的原因触发不同类型的OOM,每种OOM类型的解决方案也不同。