Is it possible to do partial garbage collection? #16061
Unanswered
kspes
asked this question in
Using MicroPython
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using micropython 1.22 and doing a split-heap. I'd like to perform partial garbage collection on demand. For example to clear one sub-heap every time garbage collection is invoked.
The reason I need this is I'm doing a performance sensitive app and would like to do pre-emptive garbage collection whenever the app detects there's time to do that. The problem is that a full garbage collection pass takes too much time.
From what I've been able to figure out studying mpy code, it scans for objects in the entire heap across all sub-heaps and then performs garbage collection. So not sure if what I propose is possible?
Beta Was this translation helpful? Give feedback.
All reactions