microsoft / microsoft/mimalloc

RSS regression: v3.1.5 → v3.3.0 shows +81% VmRSS on musl/Alpine (26 MB → 47 MB)

Open
#1,282 11 comments 3 reactions 0 assignees View on GitHub
Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

**Summary**
Upgrading from mimalloc v3.1.5 to v3.3.0 (or v3.3.1) causes an ~81% increase in resident set size for a long-running Rust async service on Alpine/musl, with no application code changes.

**Environment**
OS: Alpine 3.21 (musl libc), aarch64-unknown-linux-musl static build
Compiler: Rust 1.94.1 via cc crate (musl-gcc)
Build flags: LTO (fat), codegen-units = 1, panic = abort
Runtime: tokio (8 worker threads), long-running HTTP + MQTT service
Observed on: Linux/Kubernetes (Docker), macOS/Podman (Apple Virtualization, ARM64)

**Measurements**
Idle RSS after startup + health-check warmup, read from /proc//status (VmRSS):

| mimalloc C version | Rust crate | VmRSS |
|---|---|---|
| v3.1.5 | 0.1.48 + features=["v3"] | 26 MB |
| v3.3.0 | 0.1.49 | 45 MB |
| v3.3.1 (latest) | 0.1.50 | 47 MB |
| v2.2.2 (default in 0.1.48) | 0.1.48 (no v3 feature) | 54 MB |

All builds from the same application source, same compiler, same flags — only the mimalloc version differs.

**Reproduction**

1. Build the same Rust binary twice: once linking mimalloc v3.1.5, once linking v3.3.1
2. Run both on Alpine/musl (aarch64 or x86_64)
3. Compare VmRSS after a few seconds of idle + health-check traffic

**Workaround**
Pinned to mimalloc crate 0.1.48 with features = ["v3"] (→ C v3.1.5).

**Possibly related**
#1104 — arena lock contention / page-map overhead in dev3+
#1014 — memory regression reported by Bun
#1025 — excessive memory retention

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported comparison between mimalloc v3.1.5 and v3.3.1 using the same Rust binary on Alpine/musl, then compare VmRSS after the stated warmup. Review the changes between those mimalloc versions and the related issues #1104, #1014, and #1025. Done means identifying and addressing the regression, with measurements showing the result on the reported environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, docker, kubernetes, linux, rust
Domain
operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.