-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Hysteria2 inbound/server memory leak 1.9.3 - 1.10.0-alpha.29 #2027
Comments
I guess the problem was introduced in sing-box 1.10.0-alpha.23. Can you check if the problem exists in versions before alpha 23 or 1.9.3? |
I'm sure the problem occurred in 1.9.3 and also versions below see #1245 |
So here are the 1.9.3 dumps, took longer than expected. Uptime 1 day 14 hours. heap: So I've switched to alpha 22 as of writing this and will dump those in the next post. Thank you for your time and effort. |
1.10.0-alpha.22 goroutine: heap: All of these versions I've tested will eventually leak and system will run out of memory. If you need me to test something else and/or in different conditions I'll be happy to help |
This comment was marked as spam.
This comment was marked as spam.
Please try both 1.9.4 and 1.10.0-beta.1 |
Hello again and hope you're well :) heap: goroutine: switched to 1.10.0-beta.2 for testing |
1.10.0-beta.2 dump heap: goroutine: |
Seems fixed in 1.10.0-beta.4 :) If you don't need them you can close this issue. |
I don't think it's been resolved, beta 4 has no changes related to this issue. |
I have no progress on your issue, we did fix a memory leak. The new goroutine snapshots make me think that maybe you did have over 6k active UDP connections causing this occupancy, I'm not sure if there is still a leak. If you'd like to continue the discussion via IM, you can contact me at Telegram@attachBaseContext or Discord@nekohasekai. |
I honestly lack the knowledge to determine how much memory is required for lets say 6k active connections and I agree that it might not be a leak in that regard. But after testing beta.4 a couple of days now I clearly see multiple times that for example if sing-box is using 700MB, it will after a couple hours drop to around 500MB and then repeat back to 700MB and down again to 500MB. Anyway here is 15hr uptime pprof of beta.4 I want to thank you for taking your time on this and the reason I'm doing this to help make sing-box be as efficiently as possible I realize that no changes related to this issue is present is beta.4 but from an end-user view it is magically fixed I guess :) heap: goroutine: |
Can you try 1.9.4 again? By the way, a large number of UDP connections may be caused by protocols such as BitTorrent. You can try blocking protocol dtls and bittorrent. |
I added the following lines to my configuration under rules and have been testing it for a couple of days. Version 1.9.4 "rules":[
{
"outbound":"block",
"protocol":[
"bittorrent",
"dtls"
]
}, Memory usage is stable. Between 450MB and 750MB during peak-hours. heap: I don't mind blocking DTLS/Bittorrent traffic and if this is a fix for the memory usage I'm happy with the results and thank you for the tip. I just want to also point out that after adding these rules I checked if Bittorrent was blocked and it worked, Using qBittorrent |
I'm closing this issue for now as for me I consider this to be fixed, Sing-box never exceeds over 1GB with the amount of users I got. Thank you for your support! Be well :) |
Operating system
Linux
System version
Ubuntu 22.04
Installation type
Original sing-box Command Line
If you are using a graphical client, please provide the version of the client.
No response
Version
Description
I've been getting memory leaks from version 1.9.3 (maybe even earlier) and above.
sing-box exceeds well over 2GB of RAM after ~8 hrs of runtime, after some time it crashes. I've currently no log of the crash but can update issue when I've a log from this.
I'm still learning go so bear with me :)
btop:
goroutine:
heap:
pprof dumps:
pprof.heap.pb.gz
pprof.goroutine.pb.gz
Reproduction
This has occurred on all machines I've tested hysteria2 inbound on so it should be easy to reproduce. I would guess you need about ~100 users and after about ~12 hours of uptime
Server certs are generated by openssl.
Server config:
Logs
No response
Supporter
Integrity requirements
The text was updated successfully, but these errors were encountered: