Salted Fish Micropy Standard Library-GC garbage collection
View micropython standard library
The gc module provides a garbage collection function that can recycle garbage generated during system operation. By default, automatic recycling is allowed.
garbage collector
Basic usage
import gc
gc.enable()
-
gc.enable()
Allow automatic garbage collection -
gc.disable()
Prohibit automatic recycling, but you can manually recycle -
gc.collect()
recycle rubbish -
gc.mem_alloc()
Returns the amount of allocated memory -
gc.mem_free()
Returns the amount of remaining memory