Possible Memory Leak
操作系统
Linux
系统版本
Linux arm64
安装类型
sing-box 原始命令行程序
如果您使用图形客户端程序,请提供该程序版本。
No response
版本
sing-box version 1.8.13
Environment: go1.22.2 linux/arm64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 742adacce77f5cdb9eeb0efd67e7fbf44c966a12
CGO: disabled
描述
长时间运行后,发生OOM错误,被Docker自动重启。
重现方式
config.json :
{
"log": {
"disabled": true,
"level": "trace",
"timestamp": false
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": false,
"strict_route": false,
"sniff": false,
"endpoint_independent_nat": true,
"stack": "mixed"
}
],
"outbounds": [
{
"tag": "proxy",
"type": "selector",
"outbounds": ["auto", "direct", "sing-box-reality", "sing-box-hysteria2", "sing-box-tuic"]
},
{
"type": "vless",
"tag": "sing-box-reality",
"uuid": "xxx",
"flow": "xtls-rprx-vision",
"packet_encoding": "xudp",
"network": "tcp",
"server": "xxx",
"server_port": xxx,
"tls": {
"enabled": true,
"server_name": "xxx",
"utls": {
"enabled": true,
"fingerprint": "chrome"
},
"reality": {
"enabled": true,
"public_key": "xxx",
"short_id": "xxx"
}
}
},
{
"type": "hysteria2",
"server": "xxx",
"server_port": xxx,
"tag": "sing-box-hysteria2",
"up_mbps": 200,
"down_mbps": 1000,
"password": "xxx",
"tls": {
"enabled": true,
"server_name": "xxx",
"insecure": false,
"alpn": ["h3"]
}
},
{
"type": "tuic",
"tag":"sing-box-tuic",
"server": "xxx",
"server_port": xxx,
"uuid": "xxx",
"password": "xxx",
"congestion_control": "bbr",
"udp_relay_mode": "quic",
"tls": {
"enabled": true,
"server_name": "xxx",
"insecure": false,
"alpn": [ "h3" ]
}
},
{
"tag": "direct",
"type": "direct"
},
{
"tag": "block",
"type": "block"
},
{
"tag": "auto",
"type": "urltest",
"outbounds": ["sing-box-reality", "sing-box-hysteria2", "sing-box-tuic"],
"url": "http://www.gstatic.com/generate_204",
"interval": "1m",
"tolerance": 50
}
],
"route": {
"auto_detect_interface": true,
"final": "proxy"
},
"experimental": {
"debug": {
"listen": ":9999"
},
"clash_api": {
"external_controller": "0.0.0.0:9090",
"external_ui_download_detour": "auto",
"external_ui": "ui",
"secret": "",
"default_mode": "rule"
}
}
}
heapout svg:
After removing the vless config, it seems the OOM is gone. Will try the solution mentioned in this issue #1607
日志
支持我们
- [ ] 我已经 赞助
完整性要求
- [X] 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
- [X] 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
- [X] 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
- [X] 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。
我似乎也遇到类似的问题,我在VPS上运行sing-box 一段时间后会非常占用内存,严重的时候出现无法连接,需要重启sing-box程序才行,最多的一次观测到占用2G多内存,导致客户端无法连接服务器,重启后恢复。
sing-box版本: 1.8.12
Try latest release
memory leak in both v1.10.0-alpha.18 and v1.9.3.
The number of active connections and memory usage grow simultaneously as the following picture. This happens frequently after I add a vless forward proxy to a vless outbound using the detour attribute.
I’m new to golang and singbox, what can I do to provide more information if I meet the same situation next time?
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days