Skip to main content

init_test_rss_cap

Function init_test_rss_cap 

Source
pub fn init_test_rss_cap()
Expand description

Raise the per-process RSS fuse for the multi-conversion test harness.

latexml_core::stomach’s memory budget defaults to 4.5 GB, sized to bound a single conversion — that low default is load-bearing in production, where a massively parallel fleet runs many one-paper processes at once and the aggregate host RSS is N × cap (raising it would OOM the machine).

cargo test is the one place that runs many conversions in ONE process: libtest spawns a thread per test, so at high parallelism (e.g. -j128 on a many-core box) the process-wide RSS is the sum of all in-flight conversions and trips the single-conversion fuse on otherwise-fine documents (a false MemoryBudget cascade on article/book/report …). So the harness — not the production default — raises the cap, once, here. An explicit LATEXML_RSS_CAP_BYTES (or --test-threads=N) still wins.

pub so hand-written integration suites (e.g. 06_cluster_regressions.rs) that drive Converter directly — bypassing latexml_test_single — can opt into the same raised cap. Otherwise their conversions run under the low production default and trip a false MemoryBudget cascade at --test-threads=2 once the file accumulates enough in-flight RSS.