Skip to content

Exited with status 137 (out of memory) happened sometimes #1091

Open
@gengivan

Description

@gengivan

Hi,

Our java application got crashed from time to time with following error:

app_name index: 1, reason: CRASHED, cell_id: 738d755-0a5a-441d-96de-
2bd283f4094, instance: Cb55b580-ebb0-425-4395-51ec, exit_description: APP/PROC/WEB: Exited with status 137 (out of memory)

And we have restricted the app at maximum memory at 1.8G and following are the detailed JVM configurations including heap and etc:

JDK Version (OpenJDK 64-Bit Server VM version 17.0.11+9-LTS)
-XX:+UnlockExperimentalVMOptions -XX:TrimNativeHeapInterval=8000 -XX:ReservedCodeCacheSize=240M -XX:CompressedClassSpaceSize=100m -Xms700M -Xmx700M -XX:MetaspaceSize=300M -XX:MaxMetaspaceSize=300M -Xss512K -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:MaxGCPauseMillis=400 -XX:OnOutOfMemoryError=/home/user/app/oom.sh -XX:MaxDirectMemorySize=466M

Originally, we found that the memory usage dropped if we manually trigger System.trim_native_heap, so added TrimNativeHeapInterval option. After then, the app crashes reduced.
Reference: https://docs.oracle.com/en/java/javase/17/docs/specs/man/jcmd.html

But issue was not gone, it still happens sometimes, e.g when load increases or the app kept running for some days. From the memory usage tracking charts, we didn't see the memory was reaching the limits. So just wonder, why it throws OOM error while there was still head room?
image

We didn't see any heap related out of memory error, nor heap dump generated, so assume this 137 OOM error should be related to native memory. But from our NMT tracking logs, didn't observe any category that took more memory than expected.

So any advice to address this crash issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions