feat: add /debug/memory endpoints for production memory diagnostics#87
Closed
bolinocroustibat wants to merge 1 commit into
Closed
feat: add /debug/memory endpoints for production memory diagnostics#87bolinocroustibat wants to merge 1 commit into
bolinocroustibat wants to merge 1 commit into
Conversation
Temporary debug endpoints gated behind ENABLE_DEBUG=true env var: - GET /debug/memory -- RSS, tracemalloc top allocations, GC stats, object type counts - GET /debug/memory/snapshot -- take a tracemalloc baseline - GET /debug/memory/diff -- compare current allocations to baseline Uses only stdlib (tracemalloc, gc, resource). Returns 404 when disabled. Made-with: Cursor
a200698 to
ffc111b
Compare
Collaborator
Author
|
Since #86 seems to be solved with fewer profiling/performance calls to Sentry, this PR might not be useful anymore. Let's confirm all is good on production for a few days and than close it without merging. |
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.
Related to #86
Memory keeps growing in production even after the mcp SDK fix (PR #84). We need visibility into what is allocating memory.
Adds temporary debug endpoints gated behind
ENABLE_DEBUG=trueenv var:GET /debug/memory-- current RSS, tracemalloc top allocations, GC stats, top object typesGET /debug/memory/snapshot-- take a tracemalloc baselineGET /debug/memory/diff-- compare current allocations to the baseline, showing what grewUses only stdlib (
tracemalloc,gc,resource). Returns 404 whenENABLE_DEBUGis not set.Usage on the VM:
To be removed once the memory issue is identified and fixed.