3x-ui/internal/util
Aleksey Fedorov efe768521d
fix(memory): derive the Go soft limit from the panel's own cgroup (#7102)
The automatic soft limit read only /sys/fs/cgroup/memory.max, the root of
the cgroup namespace. A systemd MemoryMax on x-ui.service lives below that
root, so it was never seen: on a bare host the root has no memory.max and
no soft limit was set at all, and inside an LXC/Incus container the limit
came from the container (2 GiB -> "1843 MiB") while systemd killed the
panel at 650M. Either way GC never tightened before the OOM kill.

Walk from the process's own cgroup (/proc/self/cgroup) up to the visible
root and take the tightest memory.max (cgroup v2) or
memory.limit_in_bytes (v1). Docker with a private cgroup namespace sees
the same root limit as before.
2026-11-12 23:35:08 +01:00
..
common fix(url): keep capitalized mailto: and tel: links as they are (#7052) 2026-11-02 15:22:43 +01:00
cronspec fix(settings): accept five-field crontab for report and LDAP schedules 2026-10-11 20:37:04 +02:00
crypto feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
json_util fix(api): cap the client traffic list a master pushes by entry count 2026-10-31 14:25:21 +01:00
ldap feat: ldap skip tls verify (#5637) 2026-06-28 18:10:38 +02:00
link fix(link): keep IPv6 brackets in imported wireguard endpoints (#6976) 2026-11-03 15:52:09 +01:00
maskcompat fix(service): keep chunk capacity math from overflowing 2026-10-11 22:10:46 +02:00
netproxy Test-quality audit: fix 2 prod bugs, strengthen weak tests, add mutation/fuzz/CI tooling (#5345) 2026-06-15 15:17:03 +02:00
netsafe fix(netsafe): give a guarded dial one time budget for every address 2026-10-31 09:19:54 +00:00
random style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
reflect_util refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
sys fix(memory): derive the Go soft limit from the panel's own cgroup (#7102) 2026-11-12 23:35:08 +01:00
totp fix(panel): accept 2FA codes from adjacent TOTP windows (#6546) 2026-09-15 15:42:30 +03:00
version refactor(util): move panel version comparison into a shared package 2026-10-02 23:56:52 +02:00
wirecodec perf(wirecodec): decode a config envelope into one buffer 2026-10-31 09:09:22 +00:00
wireguard feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00