vihunk opened a new issue, #12229:
URL: https://github.com/apache/dubbo/issues/12229
使用hessian协议进行报文传输,当接收到消息响对报文做对象反序列化读取时,会将当前内容放入线程变量中,这块内存没有机会及时释放(除非再次发起一个别的rpc请求),虽然有调用cleanup,但该方法并未清理线程变量中的数据。
`public class Hessian2ObjectInput implements ObjectInput, Cleanable {
private static ThreadLocal<Hessian2Input> INPUT_TL =
ThreadLocal.withInitial(() -> {
Hessian2Input h2i = new Hessian2Input(null);
h2i.setSerializerFactory(Hessian2FactoryInitializer.getInstance().getSerializerFactory());
h2i.setCloseStreamOnClose(true);
return h2i;
});
private final Hessian2Input mH2i;
public Hessian2ObjectInput(InputStream is) {
mH2i = INPUT_TL.get();
mH2i.init(is);
}
// ...
}`
### Environment
* Dubbo version: 2.7.12 & 3.x
* Operating System version: linux
* Java version: 1.8
### Steps to reproduce this issue
### Expected Behavior
每个rpc请求结束后内存可被及时释放;
### Actual Behavior
实际业务场景:偶尔会发一个rpc请求(响应报文比较大(10+M)),导致每个业务处理线程(如容器开启200线程)都持有了最后一次响应的报文内容,因不及时被回收内存占用量非常明显;
--
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]