icodening commented on issue #12339:
URL: https://github.com/apache/dubbo/issues/12339#issuecomment-1620309718

   > 
我也遇到了类似的问题,现象是使用流式调用时org.apache.dubbo.rpc.protocol.tri.frame.TriDecoder中的accumulate占用的内存不断增大,导致垃圾回收频繁并且最终内存溢出。
   > 
   > 我的解决方案是在getUncompressedBody()方法中增加一个accumulate.discardReadBytes()释放已经读取过的内容
   > 
   > ```
   > private byte[] getUncompressedBody() {
   >     byte[] data = new byte[requiredLength];
   >     accumulate.readBytes(data);
   >     accumulate.discardReadBytes();
   >     return data;
   > }
   > ```
   > 
   > 经过测试之后没有再出现问题。
   > 
   > 但我还有几个问题想要请教一下, 
1、网上资料说discardReadBytes会导致性能下降,目前我自己的场景下没有明显感知,不知道有没有更好的解决方法 
2、调试中看到这一块ButyBuf类型是Direct,为什么还会在堆中产生对象 3、设置不同的JVM参数对Dubbo的性能会不会有影响
   
   是否有可复现的demo呢?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to