-
Bug
-
Resolution: Done
-
Major
-
32.0.0.Final
-
Workaround Exists
-
-
---
-
---
After the Wildfly 31 memory issue we are facing the next memory issue with Wildfly 32.0.0. All our application with W32 are impacted.
exception_class
java.lang.OutOfMemoryError
exception_message
Cannot reserve 16384 bytes of direct buffer memory (allocated: 536870913, limit: 536870912)
stacktrace
java.lang.OutOfMemoryError: Cannot reserve 16384 bytes of direct buffer memory (allocated: 536870913, limit: 536870912) at java.base/java.nio.Bits.reserveMemory(Unknown Source) at java.base/java.nio.DirectByteBuffer.<init>(Unknown Source) at java.base/java.nio.ByteBuffer.allocateDirect(Unknown Source) at io.undertow.core@2.3.13.Final //io.undertow.server.DefaultByteBufferPool.allocate(DefaultByteBufferPool.java:149) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:199) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.spec.ServletInputStreamImpl.close(ServletInputStreamImpl.java:266) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.spec.HttpServletRequestImpl.closeAndDrainRequest(HttpServletRequestImpl.java:731) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.core.ServletBlockingHttpExchange.close(ServletBlockingHttpExchange.java:89) at io.undertow.core@2.3.13.Final//io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1709) at io.undertow.core@2.3.13.Final//io.undertow.server.AbstractServerConnection$CloseSetter.handleEvent(AbstractServerConnection.java:316) at io.undertow.core@2.3.13.Final//io.undertow.server.AbstractServerConnection$CloseSetter.handleEvent(AbstractServerConnection.java:296) at org.jboss.xnio@3.8.14.Final//org.xnio.StreamConnection.lambda$mergeListeners$1(StreamConnection.java:82) at org.jboss.xnio@3.8.14.Final//org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.jboss.xnio@3.8.14.Final//org.xnio.StreamConnection.invokeCloseListener(StreamConnection.java:132) at org.jboss.xnio@3.8.14.Final//org.xnio.Connection.close(Connection.java:142) at io.undertow.core@2.3.13.Final//io.undertow.server.AbstractServerConnection.close(AbstractServerConnection.java:159) at org.jboss.xnio@3.8.14.Final//org.xnio.IoUtils.safeClose(IoUtils.java:152) at io.undertow.core@2.3.13.Final//io.undertow.server.protocol.http.HttpResponseConduit.flush(HttpResponseConduit.java:772) at io.undertow.core@2.3.13.Final//io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.flush(AbstractFixedLengthStreamSinkConduit.java:229) at org.jboss.xnio@3.8.14.Final//org.xnio.conduits.ConduitStreamSinkChannel.flush(ConduitStreamSinkChannel.java:162) at io.undertow.core@2.3.13.Final//io.undertow.channels.DetachableStreamSinkChannel.flush(DetachableStreamSinkChannel.java:119) at org.jboss.xnio@3.8.14.Final//org.xnio.channels.Channels.flushBlocking(Channels.java:63) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:627) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:504) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:599) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:335) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:132) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at org.wildfly.extension.undertow@32.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421) at org.wildfly.extension.undertow@32.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421) at org.wildfly.extension.undertow@32.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421) at org.wildfly.extension.undertow@32.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421) at org.wildfly.extension.undertow@32.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1421) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:256) at io.undertow.servlet@2.3.13.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:101) at io.undertow.core@2.3.13.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:393) at io.undertow.core@2.3.13.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363) at org.jboss.xnio@3.8.14.Final//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) at java.base/java.lang.Thread.run(Unknown Source)
FIX is ready:
We saw, there exist already a fix related to this topic, which is unfortunately not merged yet:
https://github.com/undertow-io/undertow/pull/1589/files
A patched Widlfly with an adapted ThreadLocalCache is working fine. See screenshot:
- is blocked by
-
UNDERTOW-2385 Memory leak in ThreadLocalCache
- Resolved