The short answer: the heaviest single PDF we measured — Raw records over 100,000 counted rows — needed a process whose resident memory peaked at 2.27 GiB (median of 3 fresh processes), of which the managed GC heap peaked at 744.37 MiB. The lightest (Device summary, 10,000 rows) peaked at 475.44 MiB. Two replicas generating the heaviest report at the same time ran at 0.97× the solo time — no measurable slowdown.
Heaviest task, RSS peak
2.27 GiB
Raw records · 100,000 rows · fresh process
of which managed GC heap
744.37 MiB
peak live heap across GC generations, 1s sampling
Retained 20 s after the task
2329.14 MiB
memory still held once the work finished
Concurrency factor
0.97×
two replicas vs one, same 100k-row variance report; 1.0× means no degradation
Medians of 3 fresh-process samples per group. RSS is everything the process held — managed heap, native allocations, fonts, runtime — and is the honest number for container sizing; the GC heap split says how much of that is .NET objects. Fast templates (under ~2 seconds) can have their true peak missed by 100 ms sampling, so read their peaks as lower bounds.
1. Single-task memory, fresh process per measurement
Every row below is a separate set of API processes, each generating one report and then observed idle.
| Template | Counted rows | Fresh processes | Cold execution ms, median / max | Process RSS peak MiB, median / max | RSS 20 s after, median | GC heap peak MiB, median | GC committed peak MiB, median |
|---|---|---|---|---|---|---|---|
| Variance summary variance-summary | 10,000 | 3 | 1672.57 / 1731.06 | 626.19 / 638.63 | 626.16 | 32.60 | 107.86 |
| Raw records inventory-raw-data | 10,000 | 3 | 1591.77 / 1597.59 | 613.41 / 617.88 | 613.38 | 33.40 | 107.70 |
| Device summary device-summary | 10,000 | 3 | 471.16 / 477.71 | 475.44 / 484.02 | 475.41 | 33.63 | 108.45 |
| Variance summary variance-summary | 100,000 | 3 | 12360.06 / 12482.89 | 2312.02 / 2360.50 | 2311.80 | 930.33 | 959.92 |
| Raw records inventory-raw-data | 100,000 | 3 | 12268.21 / 12299.05 | 2329.17 / 2329.33 | 2329.14 | 744.37 | 752.69 |
| Device summary device-summary | 100,000 | 3 | 2683.19 / 2686.65 | 936.00 / 937.14 | 935.97 | 394.13 | 585.41 |
Cold execution includes first-request JIT and one-off warm-up, so it is deliberately not compared with the warm-process timings from the earlier baseline. "RSS peak" covers the whole process lifetime from boot to shutdown; the task window peak is in the data files.
2. Two replicas generating at the same time
The report worker is serial inside one process by design, so the honest concurrency unit is another replica. Here both replicas rendered the variance summary of a different 100,000-row job at the same moment, against the same database and storage.
| Round | Job M2 execution ms | Job M3 execution ms | Windows overlapped |
|---|---|---|---|
| solo baseline | 11727.25 (M2) | 11916.26 (M3) | — |
| round 1 | 11632.11 | 11383.44 | yes |
| round 2 | 11901.64 | 11993.91 | yes |
| round 3 | 11314.57 | 11333.68 | yes |
Around 11.73 seconds alone became around 11.38 seconds when both ran at once — a factor of 0.97×, i.e. no measurable degradation on this host. Both replicas shared this machine's CPU and one PostgreSQL, so this is a statement about this environment, not about two isolated servers.
3. What this did not test
- Bigger jobs. 100,000 counted rows was the ceiling; larger inputs need another run before sizing for them.
- More replicas. Only two. Three or more on this 4-core VM would measure the host, not the app.
- Mixed background work. No imports, exports or catalogue builds ran alongside.
- Cloud shapes. Native macOS processes and a shared Podman VM; these numbers do not map directly onto any cloud SKU.
4. How to trust this
- Fresh process per point. Every fresh-phase measurement booted its own API process, so no heap was shared between samples.
- Real path throughout. Real organisation admin, real jobs taken through Draft → Ready → Active, licences bought through the payment Simulator checkout, the real report queue, blob upload and publication. Every PDF was verified (header, trailer, byte count, SHA-256 against the published value).
- Concurrency proven, not assumed. A round only counted when the two server-side execution windows overlapped; all 3 of 3 rounds did.
- Small samples, stated. 3 per group, medians and maxima only; no p95 is claimed.
Run 6d70b9db · version 20261014-pdf-memory · code under test 55314a49 (with uncommitted changes) · measured 2026-10-14 · 9.70 minutes end to end. Figures generated by tests/performance/20261014-pdf-memory/page.mjs from tests/performance/20261014-pdf-memory/reports.