Skip to content

fix: address memory leak issues in metagraph handling and improve axon query function#161

Open
loayei97 wants to merge 1 commit intoopentensor:mainfrom
loayei97:fix/memory-leaks
Open

fix: address memory leak issues in metagraph handling and improve axon query function#161
loayei97 wants to merge 1 commit intoopentensor:mainfrom
loayei97:fix/memory-leaks

Conversation

@loayei97
Copy link

@loayei97 loayei97 commented Jan 8, 2026

  • Updated get_query_api_axons to require a netuid and optionally accept a pre-created subtensor to prevent memory leaks.
  • Modified BaseValidatorNeuron to avoid using copy.deepcopy() on metagraph attributes, replacing it with shallow copies to mitigate memory issues.
  • Added warnings in the documentation to inform users about potential memory leaks when creating new metagraph or subtensor instances in loops.

…n query function

- Updated `get_query_api_axons` to require a `netuid` and optionally accept a pre-created `subtensor` to prevent memory leaks.
- Modified `BaseValidatorNeuron` to avoid using `copy.deepcopy()` on metagraph attributes, replacing it with shallow copies to mitigate memory issues.
- Added warnings in the documentation to inform users about potential memory leaks when creating new metagraph or subtensor instances in loops.
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