Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用serviceProxyProvider.Invoke调用接口内存持续增长 #419

Open
Penguin1990 opened this issue Oct 11, 2021 · 4 comments
Open

使用serviceProxyProvider.Invoke调用接口内存持续增长 #419

Penguin1990 opened this issue Oct 11, 2021 · 4 comments

Comments

@Penguin1990
Copy link

大佬,使用serviceProxyProvider.Invoke调用接口,压测一段时间内存一直增长,内存泄露现象好像还存在,辛苦指点下,谢谢 #413

@fanliang11
Copy link
Owner

#413 发现byte[] 长度为65560 一直占用增长未被释放,个人认为是netty 的ByteBuf未被释放,但是TransportMessageChannelHandlerAdapter里已经加了 ReferenceCountUtil.Release(buffer); 都手动释放了。

@Penguin1990
Copy link
Author

大佬,将代码
await Task.Run(() =>
{
MessageListener.OnReceived(sender, message);
});
调整为
await MessageListener.OnReceived(sender, message);
好像可以解决问题,不知是否合适?

@fanliang11
Copy link
Owner

fanliang11 commented Oct 14, 2021

首先netty 是通过EventLoop 串行执行,必然要通过Task.Run异步执行,要不然会阻塞,刚刚看了代码在ChannelRead 已经加了Task.Run,你可以试试按照以上方式修复下。

@pastespider
Copy link

字面意思应该不是这个问题,简单描述我的理解,就是使用了异步(其他线程执行),有些资源跨线程了,导致没有被合理的释放!
没看代码,有代码的不凡测测!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants