You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since gc.collect() does not move blocks when collecting trash, memory fragmentation cannot be avoided in all cases. And so it may happen that a memory area cannot be allocated eve if the total amount of free RAM is large.
The approach you made of regular and early call GC.collect() is a good strategy to keep the heap free.
There have been GC changes in mainline MicroPython. These may help to improve memory handling.
Describe the bug
Micropython's GC does not work perfect.
To Reproduce
I use the code as follows
Expected behavior
The GC works properly to ensure that the memory is not consumed.
Actual behaviour
The
print(gc.mem_free())
shows that the memory will be out of use. After one miniute,MaixPy IDE
cannot communicate to MAIX DOCK.Then, I add some code as follows:
The code means after 10 seconds, GC will be work once. Then, the memory will not be out of use.
Please complete the following information
The text was updated successfully, but these errors were encountered: