[GH-ISSUE #8917] [Issue]: native-export-memory regression flakes: its export peaks at the 128 MB heap limit #8551

Closed
opened 2026-11-07 16:43:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8917

Originally assigned to: @SpicyMarinara on GitHub.

Summary

scripts/regressions/native-export-memory.regression.ts sometimes fails with the export server running out of memory:

Error: personaZip export failed: Error: aborted
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Details

The test starts its export server with HEAP_LIMIT_MB = 128. On current staging (ad6977f8a5), three local runs reported "baseline heap 88 MB" with a peak of 128, 121 and 128 MB. The peak reaches the limit itself, so whether a run passes depends on when garbage collection runs. It failed once in CI on #8914's node-regressions 1/3 and once locally, with the same baseline heap as staging.

Raising the limit doesn't work, because the test's own control check, the buffered export that must run out of memory, then fits (it failed at 192 MB).

Expected behavior

The streamed export has real headroom under the test's limit, and the buffered control still runs out of memory. For example, the streamed path could free each image before reading the next one, or the limit and control could be sized apart.

Originally created by @SpicyMarinara on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8917 Originally assigned to: @SpicyMarinara on GitHub. ## Summary `scripts/regressions/native-export-memory.regression.ts` sometimes fails with the export server running out of memory: ``` Error: personaZip export failed: Error: aborted FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory ``` ## Details The test starts its export server with `HEAP_LIMIT_MB = 128`. On current staging (`ad6977f8a5`), three local runs reported "baseline heap 88 MB" with a peak of 128, 121 and 128 MB. The peak reaches the limit itself, so whether a run passes depends on when garbage collection runs. It failed once in CI on #8914's `node-regressions 1/3` and once locally, with the same baseline heap as staging. Raising the limit doesn't work, because the test's own control check, the buffered export that must run out of memory, then fits (it failed at 192 MB). ## Expected behavior The streamed export has real headroom under the test's limit, and the buffered control still runs out of memory. For example, the streamed path could free each image before reading the next one, or the limit and control could be sized apart.
bsakaguchi 2026-11-07 21:49:32 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Nov 7, 2026):

Fixed in #8943 (merged into staging): the export streams images as base64 slices, so its old-generation peak sits ~25 MB under the test's 128 MB limit while the buffered control still runs out.

<!-- gh-comment-id:6707873995 --> @SpicyMarinara commented on GitHub (Nov 7, 2026): Fixed in #8943 (merged into staging): the export streams images as base64 slices, so its old-generation peak sits ~25 MB under the test's 128 MB limit while the buffered control still runs out.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8551
No description provided.