Closed bb33bb closed 2 years ago
没日志且版本不是最新,不清楚具体发生了什么
最新的release,您编译的,没问题。目前最新的提交,commit的,自己编译的,会内存暴涨。
你试试最新的 8e00168914ffd9b8058ae22fa14bfbd19ec7b629 commit 还存在这个问题没有,我把依赖更新了一下
你自己编译的可以用-version
看一下有没有编译对
D:\netch-1.9.4\Netch\bin\x64\Release\bin>tun2socks.exe -version tun2socks- windows/amd64, go1.17.3,
https://user-images.githubusercontent.com/5463104/145160336-92101009-3a03-4d1b-b9b7-28d1f2162bd5.mp4
version of lable 2.3.2 isok the above video is compiled the latest commit
你拉一下新的最新的commit,然后用make debug
编译,启动的时候在原启动命令后面加上-stats :9000
这样。
运行一段时间,等内存上涨,然后浏览器进入http://127.0.0.1:9000/debug/pprof/
,看一下heap, allocs之类的信息,dump一些出来我再看看
好像确实存在内存泄露, 作者能不能把https://github.com/xjasonlyu/go-tun2socks精简一下,精简的跟https://github.com/xjasonlyu/tun2socks一样, go-tun2socks有太多鸡肋,很多路由,dns不如使用脚本自己掌控,
哪个存在内存泄漏?go-tun2socks 已经不维护了。
你怎么看出来的,我自己是长期跑在docker里当旁路由的,没有什么问题。
丢openwrt里面当主路由跑, 目前我跑的是自己git master的,现在跑你编译的v2.3.2试试
就内存占用高嘛没其他表现了?占用多少?
一直在增长,昨天晚上400多,早上起来500多,
其他倒是没什么,功能正常,
目前测v2.3.2,但是也需要几天才能得出结论,如果你连接数少,可能触发进度比较慢吧,
🤔那我等下发你一个debug版本你去测一下?
发
linux-amd64 版本的?
arm64
建议作者转向 https://github.com/shadowsocks/tun2socks 然后搞个功能跟你 这个一样的项目啊, go 占用内存太大了。
我自己用的内存一般占用低于30MB
那是你连接数太少了,
root@ee:~/tun2socks/target/release# ./tun2socks
[2022-01-11T02:55:09Z INFO tun2socks] tun device: name=utun9 address=10.192.168.10 gateway=10.192.168.1 network=10.192.168.0/24
Try:
$ curl 180.101.49.12
$ curl 172.217.25.78
$ curl "10.192.168.10:80"
$ curl "10.192.168.1:80"
# macOS
$ sudo route delete default; sudo route add default -interface utun9
$ sudo route delete default; sudo route add default 192.168.199.1
[2022-01-11T02:55:09Z INFO tun2socks] ready to go event loop...
把这个玩意搞一下,精简一下跟你现在一样的,
日常100+的connection
go 的速度很快,但是占用cpu,内存太恐怖了
反馈下,经过一天的测试, 最新的git拉取编译的发现内存泄露, 但是 https://github.com/xjasonlyu/tun2socks/releases/tag/v2.3.2 没发现内存泄露。
https://drive.google.com/file/d/1JYZ-laJzg-xHlnyI82YBs3nqAwi8G4Q2/view?usp=sharing 我用的这个软件。替换tun2socks后,可以看到视频里的效果。 需要自己有个ssr节点。
反馈下,经过一天的测试, 最新的git拉取编译的发现内存泄露, 但是 https://github.com/xjasonlyu/tun2socks/releases/tag/v2.3.2 没发现内存泄露。
我和你的结论一样。
你用上面对应的这个版本试试,我本地复现不了诶。
启动的时候在原命令后面加上-stats :9000
,运行一段时间,等内存上涨,然后浏览器进入http://[你的tun2socks机器ip]:9000/debug/pprof/
,有的dump之类的选项,导出来上传我看看🤔
tun2socks-debug-linux-arm64.zip
又出现了内存泄露。
Count | Profile
-- | --
482 | allocs
0 | block
0 | cmdline
110 | goroutine
482 | heap
0 | mutex
0 | profile
16 | threadcreate
0 | trace
threadcreate.txt allocs.txt goroutine.txt full goroutine stack dump.txt heap.txt
问题告诉出现在:heap 上面。
按照clash那边的issue的反馈,问题可能出在gvisor上
gvisor 最近更新了很多,可以编译更新库试试,
应该是的,别的地方代码基本没变
作者更新下库,编译个丢出来,一会我测测,
@f4nff 你试试
tun2socks-debug-linux-arm64.zip 我要这个版本,
@xjasonlyu 你最后编译这个,直接没法用了,
报错了么,有什么错误提示信息之类的吗?
没任何报错,也没任何数据传输,我刚才自己git了一下,跟你编译的一样,完全无法使用了
你开了log也没有任何输出吗…🤔(怕不是gVisor改了啥API不会…)
你自己试试,
我现在没管这些,仍旧用的没问题的那个release版本,自己编译的。我怀疑是后面引入了bug。目前问题是,大家都没空去整理。我不会go。
不过我觉得可以测试出来,是哪个commit引起的问题
gvisor v0.0.0-20211124014810-d07633871257,在macOS 11.6系统下貌似还存在内存泄漏的情况。
ss不支持"none"
ssserver -k "" -m "none" -s "127.0.0.1:9000"
https://github.com/shadowsocks/shadowsocks-rust
不支持此模式。
Environment
win server 2022
]v2.1.0
]Log Paste the tun2socks log below with the log level set to
DEBUG
.