Repository navigation
fix: memory leaks in CacheExtension.render_id_to_cache_key and context_processors_data WeakKeyDictionary - #1606
Closed
oliverhaas wants to merge 2 commits into
Closed
oliverhaas wants to merge 2 commits into
oliverhaas wants to merge 2 commits into
Conversation
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
oliverhaas
force-pushed
the
fix/cache-render-id-memory-leak
branch
2 times, most recently
from
March 21, 2026 20:31
88b26f2 to
52ead66
Compare
Entries were never removed. Two leak paths: - on_component_rendered read the key but never popped it. - on_component_input stored the key before checking the cache, so on cache hits the entry leaked because on_component_rendered never runs.
Cache context processor data on the request object itself instead of a module-level WeakKeyDictionary, so the cache is automatically cleaned up when the request is garbage collected.
oliverhaas
force-pushed
the
fix/cache-render-id-memory-leak
branch
from
March 21, 2026 20:32
52ead66 to
f656098
Compare
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Contributor
Performance Benchmark ResultsComparing PR changes against master branch: Benchmarks that have stayed the same:
|
Collaborator
|
@oliverhaas How come you closed this? |
Contributor
Author
|
@EmilStenstrom Sorry I kinda messed up my fork while trying out some stuff and then cleaning up. Had to create a new one... See #1613. |
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.
See#1607
Tests for reproduction mostly, can be dropped, but I would keep them.