You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/12/04 09:50:23 UTC

[GitHub] [shardingsphere-elasticjob] Technoboy- commented on issue #1746: Investigate resource leak in restful module

Technoboy- commented on issue #1746:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1746#issuecomment-738686211


   > ```
   > org.apache.shardingsphere.elasticjob.restful.pipeline.HandlerParameterDecoder
   > line 102
   > byte[] bytes = ByteBufUtil.getBytes(httpRequest.content());
   > ReferenceCountUtil.release(httpRequest.content())
   > ```
   > 
   > When i add `ReferenceCountUtil.release(httpRequest.content())` after line 102 in `HandlerParameterDecoder`, the problem is solved. So I guess , the line 102 code tigger the gc while the refCnt is keeped, which results in the problem of `ByteBuf.release() was not called before it's garbage-collected`.
   > 
   > Based on my guess, i give two solutions.
   > 
   > 1. add `ReferenceCountUtil.release(httpRequest.content())` after line 102
   > 2. avoid gc
   
   Could you help to make a pr for this ?


----------------------------------------------------------------
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.

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