Attempt to stabilise worker memory#1099
Merged
josephjclark merged 8 commits intorelease/nextfrom Oct 27, 2025
Merged
Conversation
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Short Description
This PR removes a possible memory leak which may be triggering Lost runs.
Fixes #1096 (I hope)
Implementation Details
This PR absolutely does something for me locally. Running stress tests on the Worker with a low memory limit, on this branch I seem to have total stability, where on main heap errors are frequent. So that's good.
But will this help us in production? I'm really not sure. This PR may take out the memory leak, but if our workers in production are blowing up on 40% memory capacity, then I don't think we can blame the memory leak?
Here's what I know about production:
My suspicion remains that that when the worker is processing several large JSON payloads at once in the main thread, and its working memory happens to be quite high, it's running out of heap memory. The problem here may just be that parsing large JSON objects requires a lot of memory. In which case solutions are:
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy