Summary
--max-output is applied only after user code completes. _Capture inherits StringIO and retains the full stdout/stderr in memory, so a verbose command can exhaust daemon memory even when the configured output limit is small.
Evidence
pyreplab.py stores all output in _Capture, then calls _truncate() only after exec() returns. The progress tail is bounded, but the primary buffer is not.
Expected
The configured output limit should also bound in-process memory usage.
Suggested direction
Capture a bounded head and tail plus total character or line counts, instead of retaining the whole stream. Preserve the current useful truncated-output message.
Summary
--max-outputis applied only after user code completes._CaptureinheritsStringIOand retains the full stdout/stderr in memory, so a verbose command can exhaust daemon memory even when the configured output limit is small.Evidence
pyreplab.pystores all output in_Capture, then calls_truncate()only afterexec()returns. The progress tail is bounded, but the primary buffer is not.Expected
The configured output limit should also bound in-process memory usage.
Suggested direction
Capture a bounded head and tail plus total character or line counts, instead of retaining the whole stream. Preserve the current useful truncated-output message.