-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Freedom/Direct: use simple cache instead of map cache for UDP #5043
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
Conversation
9dd19ee to
6be9c4a
Compare
f0fc56a to
bdcd3cf
Compare
bdcd3cf to
c56e165
Compare
|
起一万个这个map也才3~4MB内存 如果没有第一次写入底层数据结构不创建的话就只有650KB了 更别说这个map是会被回收的 图里的情况很明显和这个没有任何关系 |
|
I know, I didn't make this change because of RAM-problem, there is no need for map cache at all, because:
so simple variable for holding initial-converted-IP is enough. |
|
发往域的UDP请求可能被其他类型客户端发来 不管这是什么乱七八糟的情况 这只是让它不至于发生把后续目标为域的packet发到不同地方的这种离奇情况 它可能不基于回包IP跟踪 比如可能通过类似connection id的东西路由 真开始打架open reopen了 哎 |
|
Which fight? you closed this PR because you thought I did this for ram-problem, and I said the reason was something else, and reopen. but now, you've given another reason, which is true, and I close this PR base on it.
|
|
@patterniha any ideas of cause memory leak on version above 25.7.x? |
|
don't guess, get a pprof profile |
For which configuration? send client/server config. |
I will return with a few days with heap/alloc dumps. Server and client config is simple: trojan+tls and vless+tls. simple (basic) dns, no any hard routing. And yes, it is definitely something which occurs only on the 25.7.x or 25.8.x versions, 25.6.x was ran for a month with no issues
|
|
给出实际使用的xray的平台和版本号(官方版本) |
25.8.3 (xray-linux-64), release Runned on: host machine: Ubuntu 22.04, docker container: alpine linux |
|
再跑一段时间等内存占用更高了再发个看看吧 暂时没看出啥问题很大的地方 就是有很多的Trojan uot请求而已 不过这些东西一般都会被回收的不会被泄露 |
|
One of the suspicious cases is udp-dispatcher, although i didn't find any big problem with it's code, and I don't think the problem is because of that, but it is complicated and not optimized, for example there is no need to create
or for closing i simplified and optimized it: #5050, it is just simplification and optimization, and probably have nothing to do with this problem. /// ***also, after closing |
|
I think, i found the main problem: after creating new buffer, for each received UDP-data (for example in freedom), we should release it after sending it to the client. we released it in socks and shadowsocks correctly, but we didn't release it in trojan and udp_nameserver. i fix it in: 83ba3c3 @kastov test main-branch + #5046 + #5050, the memory leak problem should be solved. |



#4804 (comment)