Skip to content

Make --max-output bound capture memory, not only returned text #12

Description

@protostatis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions