Peak memory is 2× QuickJS: arena reservation, startup floor and representation
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend, performance
Research direction
Start by reviewing the heap reservation and collection logic, then measure the empty-script RSS floor and object-heavy benchmark cases named in the issue. The issue gives no file paths or test commands, so first locate the arena and startup allocation code and reproduce the reported measurements. Done means peak RSS is within 1.3× QuickJS across the 37 programs while runtime stays within 2% of today's.
Written by the indexing model from the issue text.
Description
Peak RSS of 0.3.0 is about twice QuickJS 2026-06-04's on the 37 fixed-work programs (median of 3, Ryzen 7 7840HS):
| Suite | Peak RSS, oxide / QuickJS |
|---|---|
| V8 v7 (8) | 2.09 |
| Octane 2.0 (15) | 1.83 |
| AWFY (14) | 2.19 |
| all 37 | 2.02 |
Time on the same programs is 1.03× QuickJS's, so the two together are the trade to improve. (CodeLoad, 9.6×, is a separate leak: #156.)
The collection threshold is not the cause
Halving --min-heap-mib from 4 (default) to 2, same binary, interleaved, 2 runs per program:
| Suite | time, 2 MiB / 4 MiB | peak RSS, 2 MiB / 4 MiB | RSS vs QuickJS at 2 MiB |
|---|---|---|---|
| V8 v7 | 1.006 | 0.979 | 2.04 |
| Octane | 0.985 | 0.958 | 1.75 |
| AWFY | 1.002 | 0.906 | 2.00 |
| all 37 | 0.996 | 0.942 | 1.90 |
Time does not change (largest: NBody +4%); memory drops only 6%.
Where it goes: AWFY Bounce
Live data is 215 KiB. QuickJS peaks at 4.4 MiB.
--min-heap-mib |
collections | heap reserved | peak RSS |
|---|---|---|---|
| 4 | 2 | 7,948 KiB | 12.4 MiB |
| 2 | 4 | 4,090 KiB | 10.3 MiB |
| 1 | 9 | 2,161 KiB | 9.1 MiB |
- Reserved is twice the threshold. At the 4 MiB threshold the heap reserves 7.9 MiB: object slots have 3.3× the capacity of the live count at the peak and value slots 3.3× (
--memory-report: objects 20,679 live of 68,725, values 107,607 of 358,320). The threshold counts used bytes; the arenas grow by more than that, and the free slots are split by size class. - About 7 MiB outside the heap even at a 1 MiB threshold: the empty-script floor is 5.1 MiB against QuickJS's 3.3 MiB (binary pages touched, the realm's builtins, atoms), plus compiler allocations (the stack-code intermediate of #154) that malloc keeps.
- Object representation in object-heavy programs: Splay 264.6 vs 144.0 MiB, Earley-Boyer 24.9 vs 14.6 MiB.
Direction
- Count reserved bytes, not used bytes, toward the threshold, and grow arenas in steps bounded by it; return empty arena chunks after a collection.
- Measure and cut the startup floor (lazy builtins, atom table sizing).
- Release compile-time allocations (follows from #154).
Acceptance: peak RSS within 1.3× of QuickJS over the 37 programs (geometric mean) with time within 2% of today's.
- Dominant language
- Rust
- Stars
- 61
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pocket-stack/quickjs-oxide
-
Difficulty 4/5 3-5 days Newbie friendliness 44/100
pocket-stack/quickjs-oxide#192 · 3 comments ·
-
performance.now() bypasses Host and uses std::time::Instant (unsupported on wasm32-unknown-unknown)Openbug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
pocket-stack/quickjs-oxide#165 · 1 comment ·
-
Two public SystemHost types: the core one is always UTC, the host crate's uses the system time zoneOpenenhancement
Difficulty 3/5 1-2 days Newbie friendliness 52/100
pocket-stack/quickjs-oxide#164 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 56/100
pocket-stack/quickjs-oxide#163 ·
-
Execution slow paths: inline-cache misses (Gameboy), typed-array access (zlib), array stores (Sieve)Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
pocket-stack/quickjs-oxide#157 ·
All issues in pocket-stack/quickjs-oxide
Similar issues
-
area:web kind:bug priority:p2 ready
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
sims1253/r-typeshed#140 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
storytold/craft-libs#2867 ·
Maintainers usually reply within 1 day
-
help wanted needs investigation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 62/100