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

内存溢出了, Failed to release a message: PooledUnsafeDirectByteBuf(freed) #75

Open
wangx1123-aaa opened this issue Nov 9, 2019 · 7 comments

Comments

@wangx1123-aaa
Copy link

你好,我今天用一个for 循环 10000次,连接socket服务器出现了内存溢出,并报出错误,
Failed to release a message: PooledUnsafeDirectByteBuf(freed),请问是什么原因,怎么解决呢?

@YeautyYE
Copy link
Owner

你好,我今天用一个for 循环 10000次,连接socket服务器出现了内存溢出,并报出错误,
Failed to release a message: PooledUnsafeDirectByteBuf(freed),请问是什么原因,怎么解决呢?

你是不是手动release了,导致接收或发送时自动release失败。
请把具体报错和代码贴出来

@wangx1123-aaa
Copy link
Author

wangx1123-aaa commented Nov 11, 2019 via email

@YeautyYE
Copy link
Owner

您好:   我排查了一下我的后台代码,应该是我写的有问题,有个地方一直在循环调用session.sendText(),循环次数很多,是不是这个问题?

sendText传的是string的话是没有问题的

@wangx1123-aaa
Copy link
Author

wangx1123-aaa commented Nov 13, 2019 via email

@YeautyYE
Copy link
Owner

------------------ 原始邮件 ------------------ 发件人: "Yeauty"<notifications@github.com>; 发送时间: 2019年11月12日(星期二) 中午1:08 收件人: "YeautyYE/netty-websocket-spring-boot-starter"<netty-websocket-spring-boot-starter@noreply.github.com>; 抄送: "qqqqqq"<632343976@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [YeautyYE/netty-websocket-spring-boot-starter] 内存溢出了, Failed to release a message: PooledUnsafeDirectByteBuf(freed) (#75) 您好:     我怀疑我的代码是在这个地方出了问题,    sessionList中存了大概5000个session,当时因为代码问题,这5000个session是同一个对象,然后调这个for循环大概被调用了10000次,   大神,我直接session.sendText 就行了吗,不用手动release是吗?   另外上生产环境有需要注意和优化的地方吗?   望不吝赐教 您好:   我排查了一下我的后台代码,应该是我写的有问题,有个地方一直在循环调用session.sendText(),循环次数很多,是不是这个问题? sendText传的是string的话是没有问题的 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

sendText传的是string的话是没有问题的,不需要手动release。
你可以把代码发出来。

@wangx1123-aaa
Copy link
Author

wangx1123-aaa commented Nov 15, 2019 via email

@YeautyYE
Copy link
Owner

YeautyYE commented Nov 16, 2019

您好:  能问个问题吗? 用netty 实现websocket 和 springboot 集成的websocket 哪个性能更好?

请看 #59

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

2 participants