Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request to allow service to crash if direct memory is OOM #1901

Closed
DanielRentschler opened this issue Jan 14, 2025 · 1 comment · Fixed by #1916
Closed

Feature Request to allow service to crash if direct memory is OOM #1901

DanielRentschler opened this issue Jan 14, 2025 · 1 comment · Fixed by #1916
Assignees

Comments

@DanielRentschler
Copy link
Member

The direct memory of our service recently ran into an OOM exception for direct memory during testing.

Our expectation initially was that the service would automatically restart because we enabled the jvm flag -XX:+CrashOnOutOfMemoryError.

Later we found out that this flag is only used for heap or metaspace OOM. More details in this openJDK bug repot

Would it be possible to introduce a new flag that would react in the same way as -XX:+CrashOnOutOfMemoryError but includes direct memory.

@ansteiner
Copy link
Member

root cause:
"Caused by: java.lang.OutOfMemoryError: Cannot reserve 16709 bytes of direct buffer memory (allocated: 10477782, limit: 10485760)",
"\tat java.base/java.nio.Bits.reserveMemory(Bits.java:178)",
"\tat java.base/java.nio.DirectByteBuffer.(DirectByteBuffer.java:121)",
"\tat java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:332)",
"\tat java.base/sun.nio.ch.Util.getTemporaryDirectBuffer(Util.java:243)",
"\tat java.base/sun.nio.ch.IOUtil.read(IOUtil.java:293)",
"\tat java.base/sun.nio.ch.IOUtil.read(IOUtil.java:266)",
"\tat java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:525)",
"\t... 23 more"

Closed openjdk issue for similar request: openjdk/jdk#16176 (comment)

ansteiner added a commit to ansteiner/SapMachine that referenced this issue Feb 6, 2025
ansteiner added a commit that referenced this issue Feb 11, 2025
… memory is OOM (#1916)

SapMachine #1901: Feature Request to allow service to crash if direct memory is OOM
ansteiner added a commit to ansteiner/SapMachine that referenced this issue Feb 12, 2025
…ect memory is OOM (SAP#1916)

SapMachine SAP#1901: Feature Request to allow service to crash if direct memory is OOM

(cherry picked from commit 1ce231f)
ansteiner added a commit to ansteiner/SapMachine that referenced this issue Feb 12, 2025
…ect memory is OOM (SAP#1916)

SapMachine SAP#1901: Feature Request to allow service to crash if direct memory is OOM

(cherry picked from commit 1ce231f)
@ansteiner ansteiner self-assigned this Feb 12, 2025
RealCLanger pushed a commit that referenced this issue Feb 13, 2025
… memory is OOM (#1916)

SapMachine #1901: Feature Request to allow service to crash if direct memory is OOM

(cherry picked from commit 1ce231f)
RealCLanger pushed a commit that referenced this issue Feb 13, 2025
… memory is OOM (#1916)

SapMachine #1901: Feature Request to allow service to crash if direct memory is OOM

(cherry picked from commit 1ce231f)
RealCLanger pushed a commit that referenced this issue Feb 13, 2025
… memory is OOM (#1916)

SapMachine #1901: Feature Request to allow service to crash if direct memory is OOM

(cherry picked from commit 1ce231f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants