From the linux journal file, the "java.lang.OutOfMemoryError: Direct buffer memory" exception was logged. How do I catch the exception, so that I can create a heap dump of my java process? I will also need to know how I can restart the java program when exception occurs. However, I will post another question for that. By the way, the Java tool option, " -XX:+HeapDumpOnOutOfMemoryError", does not create a heap dump on direct memory exceptions.
Sep 20 23:02:55 CKM01204505062-A control-path[128819]: 2021-09-20 23:02:55.266 [] [INFO] [com.emc.bedrock.http.HttpVerticle|vert.x-eventloop-thread-3] Request ID: 2c7633a4-db9c-4ec5-b4ca-c93c47512384 completed in 4 ms. Sep 20 23:02:55 CKM01204505062-A control-path[128199]: Exception in thread "iothread-2" java.lang.OutOfMemoryError: Direct buffer memory Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at java.nio.Bits.reserveMemory(Bits.java:695) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at java.nio.DirectByteBuffer.(DirectByteBuffer.java:123) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.DecoderBase.(DecoderBase.java:35) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.V1Decoder.(V1Decoder.java:21) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.StreamEngine.newDecoder(StreamEngine.java:102) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.StreamEngine.handshake(StreamEngine.java:549) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.StreamEngine.inEvent(StreamEngine.java:278) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.IOObject.inEvent(IOObject.java:86) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at zmq.Poller.run(Poller.java:228) Sep 20 23:02:55 CKM01204505062-A control-path[128199]: at java.lang.Thread.run(Thread.java:748)