Skip to content
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

Possible Memory Leak #1736

Open
4 of 5 tasks
bigfei opened this issue May 5, 2024 · 1 comment
Open
4 of 5 tasks

Possible Memory Leak #1736

bigfei opened this issue May 5, 2024 · 1 comment

Comments

@bigfei
Copy link

bigfei commented May 5, 2024

操作系统

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:
profile002

After removing the vless config, it seems the OOM is gone.
Will try the solution mentioned in this issue #1607

日志

支持我们

完整性要求

  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。
@siwee
Copy link
Contributor

siwee commented May 9, 2024

我似乎也遇到类似的问题,我在VPS上运行sing-box 一段时间后会非常占用内存,严重的时候出现无法连接,需要重启sing-box程序才行,最多的一次观测到占用2G多内存,导致客户端无法连接服务器,重启后恢复。

sing-box版本: 1.8.12

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants