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

big bug 内存泄漏,2.0.12版本仍然未解决 #1000

Open
SunnyBoyLJQ opened this issue Sep 5, 2024 · 6 comments
Open

big bug 内存泄漏,2.0.12版本仍然未解决 #1000

SunnyBoyLJQ opened this issue Sep 5, 2024 · 6 comments

Comments

@SunnyBoyLJQ
Copy link

SunnyBoyLJQ commented Sep 5, 2024

2.0.11,2.0.12版本都仍然存在内存泄漏,链接断开后packet仍然在不断地增加

@bwzhang2011
Copy link

能否有一些日志贴出来(究竟事怎样的内存斜口)、然后能否有工程再现该错误

@liguochuan00
Copy link

同样的问题,出现内存泄漏

@SunnyBoyLJQ
Copy link
Author

每次建立连接AuthorizeHandler这个类中的channelRead方法两次,导致channelRead调用本类的authorize方法每次都会往clientsBox中put一个ClientHead,但是在连接断开时又只remove一个,导致加二减一情况出现,clientsBox无限膨胀导致内存溢出,麻烦作者看到解决一下,谢谢,主要原因是channelRead重复调用

@SunnyBoyLJQ SunnyBoyLJQ changed the title big bug 内存泄漏 big bug 内存泄漏,2.0.12版本仍然未解决 Nov 8, 2024
@SunnyBoyLJQ
Copy link
Author

SunnyBoyLJQ commented Nov 27, 2024

@liguochuan00 > 能否有一些日志贴出来(究竟事怎样的内存斜口)、然后能否有工程再现该错误

兄弟你解决了吗

@ACCia
Copy link

ACCia commented Jan 13, 2025

@SunnyBoyLJQ 有没有泄露的测试代码,看了下,应是没有保持会话的问题。sessionId重复创建新的导致clientsBox一直在put。clientHead里面有超时关闭。应该没多大问题。突然的大量并发可能会出问题。

@ACCia
Copy link

ACCia commented Jan 13, 2025

@SunnyBoyLJQ 如果你用的是js的client开一下withCredentials: true 传输跨域的cookie。
https://socket.io/docs/v4/client-options/#withcredentials
这样就可以防止重复put了。

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

4 participants