# Repeated HEVC recordings release native surfaces The opt-in `video_writer::tests::headless_encoder_memory` probe creates 51 half-second, 640×360 HEVC movies on one Rust thread, using synthetic CMSampleBuffers. It never opens a screen stream or microphone. Each movie is deleted after it finishes. `footprint` and `vmmap -summary` sample every ten cycles; the Python runner checks retained IOSurface bytes against a 4 MiB growth budget. Run it on a macOS build worker through the build scheduler: ```sh cargo nextest list --locked -p capture-core --message-format json > /tmp/encoder-tests.json python3 perf/run-encoder-memory.py /tmp/encoder-tests.json 0 fixed ``` Mode `0` leaves pool ownership entirely to the production writer. Mode `1` adds an outer pool to each test movie, a diagnostic control. The runner creates a temporary HOME and data root. Results go under `.lab-output/headless-pipelines/encoder/