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.
Hello, we are the owners of https://github.com/macrocosm-os/data-universe/commits/main/
Currently, here is our package dependency tree
During a memory leak investigation, with the following snippet
in this validator file: https://github.com/macrocosm-os/data-universe/blob/main/neurons/validator.py
I noticed that he memory allocations of this specific item grows over time, about 100-200MB/h
Here is a sample of our trace:
Growing up to:
steadily.
After applying a patch in this PR, the memory seems to have stabilized or at least significantly slowed down:
The problem seems to be that this dynamically creates a brand-new class for (almost) every parametric type string it encounters.
If you feed lots of distinct type strings (or even repeat them without caching), this hammers the allocator and ABC machinery ( in your stack) by repeatedly constructing subclasses.
We would not need a new class per subtype—you just need a decoder configured with a subtype.
Right now I am not sure if this is a problem here, or a usage problem in one of the upstream packages of
async-substrate-interface
, orbittensor
. This can potentially affect other bittensor subnets.