You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "binfeiruci (via GitHub)" <gi...@apache.org> on 2023/12/13 09:34:06 UTC

[I] memory leak in rest [dubbo]

binfeiruci opened a new issue, #13492:
URL: https://github.com/apache/dubbo/issues/13492

   I got this error log:
   ```
   2023-11-23 19:23:26.786 ERROR 27 --- [NettyServerWorker-thread-1]  io.netty.util.ResourceLeakDetector       : LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
   Recent access records: 
   Created at:
           io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:385)
           io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:187)
           io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:173)
           io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:107)
           org.apache.dubbo.rpc.protocol.rest.extension.resteasy.ResteasyContext.convertHttpRequestToContainerRequestContext(ResteasyContext.java:81)
           org.apache.dubbo.rpc.protocol.rest.extension.resteasy.filter.ResteasyRequestContainerFilterAdapter.filter(ResteasyRequestContainerFilterAdapter.java:54)
           org.apache.dubbo.rpc.protocol.rest.handler.NettyHttpHandler.executeFilters(NettyHttpHandler.java:131)
           org.apache.dubbo.rpc.protocol.rest.handler.NettyHttpHandler.handle(NettyHttpHandler.java:82)
           org.apache.dubbo.rpc.protocol.rest.netty.RestHttpRequestDecoder.lambda$decode$0(RestHttpRequestDecoder.java:70)
           java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           org.apache.dubbo.common.threadlocal.InternalRunnable.run(InternalRunnable.java:41)
           java.lang.Thread.run(Thread.java:748)
   ```
   
   the reason: 
   org.apache.dubbo.rpc.protocol.rest.extension.resteasy.filter.ResteasyRequestContainerFilterAdapter#filter creates a DubboPreMatchContainerRequestContext. DubboPreMatchContainerRequestContext's NettyHttpRequest field contains a ByteBuf.
   ResteasyRequestContainerFilterAdapter#filter doesn't release the ByteBuf before exit.
   
   solution:
   call containerRequestContext.getHttpRequest().releaseContentBuffer() before exit. like
   ```
   finally {
               containerRequestContext.getHttpRequest().releaseContentBuffer();
           }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] memory leak in rest [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #13492: memory leak in rest 
URL: https://github.com/apache/dubbo/issues/13492


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] memory leak in rest [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13492:
URL: https://github.com/apache/dubbo/issues/13492#issuecomment-1855667865

   Can you please submit a PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org