Skip to content

Conversation

@thewhaleking
Copy link
Collaborator

Fixes two memory leaks (one in async one in sync).

The async leak was caused by the singleton CachedFetcher, whose instances were not garbage collected.

The sync leak was caused by functools LRU cache whose cache was not garbage collected (caused because self is also cached)

Resolves #255
Resolves opentensor/bittensor#3237
Resolves opentensor/bittensor#3235

@thewhaleking thewhaleking requested a review from a team February 3, 2026 14:36
@thewhaleking thewhaleking added run-bittensor-sdk-tests Runs Bittensor SDK tests. run-bittensor-cli-tests Runs BTCLI tests. bug Something isn't working labels Feb 3, 2026
@thewhaleking thewhaleking changed the title fix memory leak DO NOT MERGE [WIP] fix memory leak Feb 3, 2026
@thewhaleking thewhaleking changed the title DO NOT MERGE [WIP] fix memory leak fix memory leak Feb 3, 2026
@thewhaleking thewhaleking merged commit 3bfa833 into staging Feb 3, 2026
145 of 146 checks passed
@thewhaleking thewhaleking deleted the fix/thewhaleking/memory-leak branch February 3, 2026 17:05
@thewhaleking thewhaleking mentioned this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working run-bittensor-cli-tests Runs BTCLI tests. run-bittensor-sdk-tests Runs Bittensor SDK tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants