SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
15.5k stars 1.9k forks source link

Windows 下似乎存在内存泄漏 #1816

Closed DarkCWK closed 4 weeks ago

DarkCWK commented 4 weeks ago

操作系统

Windows

系统版本

22631.3593

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.9.0

Environment: go1.22.3 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 5ff7006326e8a876d33d92b26ebd2671cdd48b9f
CGO: disabled

描述

似乎有地方内存泄漏, 在一整天的运行后,内存占用达到 3G image

重现方式

长时间运行 gsudo "path/to/sing-box.exe" -c "path/to/config.json" run

相关配置文件

{
    "log": {
        "level": "trace"
    },
    "dns": {
        "servers": [
            {
                "tag": "114-dns",
                "address": "114.114.114.114",
                "detour": "direct-out"
            },
            {
                "tag": "114-v4-dns",
                "address": "114.114.114.114",
                "strategy": "ipv4_only",
                "detour": "direct-out"
            }
        ],
        "rules": [
            {
                "inbound": [
                    "tun-in"
                ],
                "domain": [
                    "****.*****.**",
                    "****.***************.***",
                    "***.******.*******.***",
                    "*.****.********.******.***",
                    "******.*******.***"
                ],
                "server": "114-dns"
            },
            {
                "inbound": [
                    "tun-in"
                ],
                "server": "114-v4-dns"
            }
        ],
        "reverse_mapping": true
    },
    "route": {
        "auto_detect_interface": true,
        "rules": [
            {
                "inbound": "mixed-in",
                "outbound": "urltest-out"
            },
            {
                "inbound": "tun-in",
                "port": 53,
                "outbound": "dns-out"
            },
            {
                "inbound": "tun-in",
                "domain": [
                    "****.*****.**",
                    "****.***************.***",
                    "***.******.*******.***",
                    "*.****.********.******.***",
                    "******.*******.***"
                ],
                "outbound": "http-out"
            },
            {
                "inbound": "tun-in",
                "domain_suffix": [
                    "github.com",
                    "githubassets.com",
                    "githubusercontent.com",
                    "github.io",
                    "google.com",
                    "google.com.hk"
                ],
                "outbound": "urltest-out"
            },
            {
                "inbound": "tun-in",
                "outbound": "direct-out"
            }
        ]
    },
    "inbounds": [
        {
            "type": "mixed",
            "tag": "mixed-in",
            "listen": "0.0.0.0",
            "listen_port": 9000
        },
        {
            "type": "tun",
            "tag": "tun-in",
            "inet4_address": "172.31.0.2/24",
            "inet6_address": "FC01::2/16",
            "auto_route": true,
            "strict_route": true
        }
    ],
    "outbounds": [
        {
            "type": "dns",
            "tag": "dns-out"
        },
        {
            "type": "shadowsocks",
            "tag": "ss-out1",
            "server": "***.******.******.***",
            "server_port": 00000,
            "method": "2022-blake3-aes-256-gcm",
            "password": "*****************************************************************************************",
            "detour": "direct-out"
        },
        {
            "type": "shadowsocks",
            "tag": "ss-out2",
            "server": "***.******.******.***",
            "server_port": 00000,
            "method": "2022-blake3-aes-256-gcm",
            "password": "*****************************************************************************************",
            "detour": "direct-out"
        },
        {
            "type": "vmess",
            "tag": "vmess-out1",
            "server": "***.******.******.***",
            "server_port": 00000,
            "uuid": "************************************",
            "detour": "direct-out"
        },
        {
            "type": "vmess",
            "tag": "vmess-out2",
            "server": "***.******.******.***",
            "server_port": 00000,
            "uuid": "************************************",
            "detour": "direct-out"
        },
        {
            "type": "vless",
            "tag": "vless-out",
            "server": "**.****.*******.******.***",
            "server_port": 00000,
            "uuid": "************************************",
            "packet_encoding": "xudp",
            "tls": {
                "enabled": true,
                "insecure": false,
                "server_name": "******************.***.*******.***",
                "utls": {
                    "enabled": true,
                    "fingerprint": "firefox"
                },
                "reality": {
                    "enabled": true,
                    "public_key": "*******************************************",
                    "short_id": "********"
                }
            },
            "transport": {
                "type": "http",
                "path": "******"
            },
            "detour": "direct-out"
        },
        {
            "type": "http",
            "tag": "http-out",
            "server": "****.********.***",
            "server_port": 0000,
            "detour": "direct-out"
        },
        {
            "type": "urltest",
            "tag": "urltest-out",
            "outbounds": [
                "ss-out1",
                "ss-out2",
                "vmess-out1",
                "vmess-out2",
                "vless-out",
                "http-out"
            ]
        },
        {
            "type": "direct",
            "tag": "direct-out"
        }
    ]
}

我看见下方要求 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。 ,我仅对代理服务器信息和个人网址进行了脱敏,我认为这是必要的

日志

No response

支持我们

完整性要求

dyhkwong commented 4 weeks ago

内存泄漏问题请提供 pprof。