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

Open
DanielRentschler opened this issue Jan 14, 2025 · 1 comment
Open

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants