-
Notifications
You must be signed in to change notification settings - Fork 49
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
Why not delete room or peer if they are useless #32
Comments
There is no limit the number of elements in map in golang. It does occupy more memory if service running for a long time, but the size of a blank map is small, I think there doesn't have much effect. |
Sorry, I don't think the effect is small. Below is the info of kraken deployed in my server. There're only 6 active users but 2486 inactive users. The kraken service uses almost 500MB memory. When the service is just started, the memory usage was below 100MB. The map is not blank also, all {
"data":{
"updated_at":"2022-11-26T04:02:16.544191438Z",
"active_peers":6,
"closed_peers":2486,
"active_rooms":4,
"closed_rooms":119
},
"id":"1d870674-9329-44f7-b218-e40db615f52c"
}
|
Thanks, will check and fix it |
I used the change in this PR #33. The service uses only 40MB memory after running for more than 12 hours. Above screenshot is also captured after the service running about 12 hours. This change solves the biggest memory leak problems. |
I found the peer and room data in these 2 struct will never be deleted. I think this memory leak is a problem if the service running for a long time. What do you think?
The text was updated successfully, but these errors were encountered: