Your peak RSS depends on which CPU you ran on
The same binary reported peak memory anywhere from 2,436 to 2,824 KiB across 20 runs. Four things we learned about measuring a JavaScript engine's memory before we could trust a single number.
Quench has a memory goal as well as a speed goal, so in October 2026 we built a scoreboard that failed any row where peak memory was more than 0.8 times the best other engine. Then rows started passing and failing without any code change.
1. Since Linux 6.2, RSS is counted per CPU
One RayTrace binary read 2,436 KiB of peak memory in one run and 2,592 KiB in another, pinned to a core. Across 20 runs the same binary ranged from 2,436 to 2,824.
Since Linux 6.2 the kernel keeps the RSS counters per CPU and reconciles them lazily. A process that migrates between cores can have its peak read low. The fix is boring: pin the process to one core for every memory measurement. The scoreboard does that now, and reports the worst of several pinned runs.
2. Address space layout changes instruction counts
We use callgrind instruction counts for speed decisions because they repeat exactly. Except they did not: with address space randomization on, the main thread's count flipped between two levels about 4.6% apart, depending on where things landed. A/B comparisons now run with randomization off.
3. The profile you train on is a hidden input
Our release builds are laid out by BOLT using a recorded profile. A scratch recipe passed three boards in a row. The identical recipe in the repository failed all three.
The difference was one line in a package.json. It had "type": "module", so every file in the training corpus loaded as an ES module, and the CommonJS loading path was never profiled. The hot code for CommonJS programs was laid out as if it were cold. Retraining moved single rows by 100 to 250 KiB.
4. The memory policy that was a code layout problem
We had a memory-first mode that released code pages at every collection. It met the memory target on six of eight benchmarks and cost 17 to 30% of the score on four. The obvious reading: collecting more often is slow.
The obvious reading was wrong. Turning off code release alone gave RayTrace 28% of its score back for 192 KiB of memory. The collector was fine. The time was going to page faults, bringing back code that had just been released and was needed again straight away.
with code release off
of keeping the code
over about 2,900 live objects
A release policy cannot fix that. What fixes it is layout: keep the code a running program needs on pages that are never released, and release only what is truly cold.
What the board looked like once we trusted it
With pinning, fixed layout and a correct profile, the memory-first board on 27 October read as follows.
Quench used between 0.34 and 0.74 times the memory of the next-lowest engine on every row. That mode was not the default, because of the score cost. The point of the chart is that the numbers held still long enough to argue about.
The checklist
- Pin to one core for memory. Report the worst of several runs.
- Turn off address randomization for instruction-count comparisons.
- Treat the training profile as source code. Review what it actually exercised.
- When a policy costs speed, find out where the time went before tuning the policy.
- Copy the binary before measuring a cold start, because you cannot evict pages a running process still maps.