Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-4284

Calling remote asynchronous void method causes OutOfMemoryError in direct buffer memory

XMLWordPrintable

    • Workaround Exists
    • Hide

      Add command line option -Djboss.remoting.pooled-buffers=false. Though some reported a big performance impact.

      Show
      Add command line option -Djboss.remoting.pooled-buffers=false . Though some reported a big performance impact.
    • Hide
      1. Build attached EJB and its client.
        unzip async-void-ejb.zip
        cd async-void-ejb
        mvn clean package dependency:copy-dependencies
        
      2. Add an ApplicationRealm user (jboss/jbossjboss#2) to a standalone server.
      3. Deploy target/async-void-ejb-1.0.0.jar to the standalone server.
      4. Run the test client.
        java -cp target/dependency/\*:target/test-classes:target/classes -Xms100m -Xmx100m TestMainDBufferLeak
        
      Show
      Build attached EJB and its client. unzip async-void-ejb.zip cd async-void-ejb mvn clean package dependency:copy-dependencies Add an ApplicationRealm user ( jboss / jbossjboss#2 ) to a standalone server. Deploy target/async-void-ejb-1.0.0.jar to the standalone server. Run the test client. java -cp target/dependency/\*:target/test-classes:target/classes -Xms100m -Xmx100m TestMainDBufferLeak
    • EAP 7.0.1

      OOME in direct buffer happens when a remote client calls an asynchronous method which has return type void many times.

      2016-04-20 17:10:23,140 INFO  (Thread-28) [TestMainDBufferLeak] invoked=599,000, total=98,590,724, used=98,590,724, count=49 
      2016-04-20 17:10:23,766 ERROR (Remoting "config-based-ejb-client-endpoint" I/O-1) [org.xnio.listener] XNIO001007: A channel event listener threw an exc
      eption 
      java.lang.OutOfMemoryError: Direct buffer memory
              at java.nio.Bits.reserveMemory(Bits.java:693)
              at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:123)
              at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
              at org.xnio.BufferAllocator$2.allocate(BufferAllocator.java:57)
              at org.xnio.BufferAllocator$2.allocate(BufferAllocator.java:55)
              at org.xnio.ByteBufferSlicePool.allocate(ByteBufferSlicePool.java:146)
              at org.jboss.remoting3.remote.RemoteConnection.allocate(RemoteConnection.java:77)
              at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:290)
              at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:46)
              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
              at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:199)
              at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:113)
              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
              at org.xnio.ChannelListeners$DelegatingChannelListener.handleEvent(ChannelListeners.java:1092)
              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
              at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
              at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
              at org.xnio.nio.WorkerThread.run(WorkerThread.java:559)
      

              rhn-support-onagano Osamu Nagano
              elguardian@gmail.com Enrique González Martínez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: