Skip to content

Conversation

guybedford
Copy link
Collaborator

This fixes a memory leak when handling multiple instances of durable objects.

The panic handler proxy system stored the instances assuming one-time use, but we need to ensure GC'able reuse.

This resolves that handling by associating each of the proxies lazily with its instance identity, and then instead of reconstructing instances on the panic reset, instead reconstructing instances on the next entrypoint call.

This also inlines a large allocation for memory testing on the local test suite thanks to @lukevalenta's replication. In the process, including miniflare and compat flag updates to properly test finalization.

@guybedford
Copy link
Collaborator Author

Resolves #722.

@guybedford guybedford merged commit 71f384f into main Sep 24, 2025
6 checks passed
@guybedford guybedford deleted the fix-memory-leak branch September 24, 2025 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant