reduce memory usage (#1133)

Large memory usage comes from:

Mimalloc hold large thread cache, causing abort 13M+ usage.
QUIC endpoint occupy 3M when GRO is enabled.
Smoltcp 64 tcp listener use 2MB.
This commit is contained in:
Sijie.Sun
2025-07-20 19:15:28 +08:00
committed by GitHub
parent 2660ed5fda
commit 876d550f68
11 changed files with 233 additions and 140 deletions

View File

@@ -175,14 +175,17 @@ jobs:
fi
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
cargo +nightly build -r --target $TARGET -Z build-std=std,panic_abort --package=easytier
cargo +nightly build -r --target $TARGET -Z build-std=std,panic_abort --package=easytier --features=jemalloc
else
if [[ $OS =~ ^windows.*$ ]]; then
SUFFIX=.exe
CORE_FEATURES="--features=mimalloc"
else
CORE_FEATURES="--features=jemalloc"
fi
cargo build --release --target $TARGET --package=easytier-web --features=embed
mv ./target/$TARGET/release/easytier-web"$SUFFIX" ./target/$TARGET/release/easytier-web-embed"$SUFFIX"
cargo build --release --target $TARGET
cargo build --release --target $TARGET $CORE_FEATURES
fi
# Copied and slightly modified from @lmq8267 (https://github.com/lmq8267)
@@ -212,8 +215,8 @@ jobs:
rustup set auto-self-update disable
rustup install 1.86
rustup default 1.86
rustup install 1.87
rustup default 1.87
export CC=clang
export CXX=clang++
@@ -221,7 +224,7 @@ jobs:
cargo build --release --verbose --target $TARGET --package=easytier-web --features=embed
mv ./target/$TARGET/release/easytier-web ./target/$TARGET/release/easytier-web-embed
cargo build --release --verbose --target $TARGET
cargo build --release --verbose --target $TARGET --features=mimalloc
- name: Compress
run: |

View File

@@ -29,8 +29,8 @@ fi
# see https://github.com/rust-lang/rustup/issues/3709
rustup set auto-self-update disable
rustup install 1.86
rustup default 1.86
rustup install 1.87
rustup default 1.87
# mips/mipsel cannot add target from rustup, need compile by ourselves
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then