Skip to content

Conversation

@agents-git-bot
Copy link

Summary

Documents memory management improvements and state cleanup behaviors introduced in cloudflare/sandbox-sdk#224.

Changes:

  • Added Process management > Memory management section explaining how completed processes are persisted to disk and freed from memory
  • Added Automatic state cleanup section in Lifecycle API documenting Durable Object cleanup on container sleep/restart
  • Clarified that stream listeners are automatically cleaned up when operations complete or are cancelled

Context

This PR syncs documentation for Fix memory leaks in process management, which fixed three sources of memory leaks:

  1. ProcessStore now persists completed processes to disk and frees memory
  2. ReadableStream cancel handlers now remove listeners when streaming stops
  3. Sandbox onStop lifecycle hook now clears stale Durable Object state after container restarts

Related


Automated sync from sandbox-sdk repository

Synced from cloudflare/sandbox-sdk#224

Added documentation for:
- Process store memory management with disk persistence
- Automatic stream listener cleanup
- Durable Object state cleanup on container sleep/restart

These improvements prevent memory leaks in long-running sandboxes
and ensure clean state after container restarts.
@github-actions
Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/sandbox/ @whoiskatrin, @ghostwriternr, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants