Closed Mahdi-zarei closed 1 year ago
I have this problem too. For me it’s mixed inbound only, tun works ok. My server is Xray, so it’s probably client’s fault.
I'm running sing-box on OpenWRT with limited ram so this is something which happens quiet frequently (every hour).
To make sure kernel kills sing-box before running out of memory I run it under ulimit -v 70000000
.
This crash log happend an hour ago, unfortunately I lost some part of it due to limited log buffer:
I'll try to increase the log buffer to get the whole thing.
Version of sing-box
Client configuration file
@nekohasekai Is there anything else I should provide?
it seems to me like a context leak, a context is being created and is never being cancelled, contexts should always be released or they will keep occupying the memory.
i found the problem, you are using a single context to create child contexts for every connection, and contexts do not get collected by the garbage collector unless you call their cancel function or their parent context is cancelled, which neither happens in this case, you need to create a new context for each connection from the parent context and defer its cancel function.
This is ridiculous. Contrary to what you said, valueCtx does not leak.
I remind you that to prove a memory leak or debug a problem, use the pprof tool.
Welcome
Description of the problem
I am using VLESS with Reallity for my setup, and the amount of ram used slowly increases up until the kernel kills sing-box, I have checked and there is no abnormal count of connections, so I would assume the problem is not from high number of connections, the process of ram getting all used up happens in like 2 days so It's not caused by load surges either.
Version of sing-box
Server and client configuration file
Server and client log file