033 DON'T LET MICROPYTHON'S GARBAGE COLLECTOR RUIN YOUR PROGRAM
Like most high-level languages, there needs to be a feature to clean up the mess programmers leave. In low level languages the program is required to clear up unused variables, pointers etc. Micropython's device to automatically do this is called the Garbage Collector. It works great, BUT, it takes time to execute and it can cause intermittent pauses in your program. In this video, we cover this problem in detail with a very real and practical problem and solution.
VISIT OUR COMPANION WEBSITE
makingstuffwit...
INDEX TO ZOOMTOWN VIDEO SERIES
makingstuffwit...
REPOSITORY FOR ZOOMTOWN SOURCE CODE & OTHER DATA
makingstuffwit...
Some of the technologies explored in this experiment include, but is certainly not limited to:
[*] Autonomous Robotics
[*] Photo reflective sensors
[*] Time of flight sensors
[*] Hall effect sensors
[*] Rotary encoders
[*] Odometry
[*] Line following
[*] Color recognition and detection sensor
[*] Automatic route planning
[*] Localization
[*] Robotic cars
[*] Dead Reckoning
#Garbagecollector #micropython #pico #picow
Пікірлер: 17
No garbage here. Another interesting and informative video. Thanks.
@MakingStuffwithChrisDeHut
2 ай бұрын
Glad you enjoyed it. Cheers! Chris
Still no download for 033, hope will be posted soon.
@MakingStuffwithChrisDeHut
2 ай бұрын
Thanks for letting me know. I also got the site updated for Episode 34 Cheers! Chris
Is 033 source code posted? Didn't see it on the bottom of the list.
@MakingStuffwithChrisDeHut
2 ай бұрын
Sorry for not posting it right away - real life has been getting in my way of fun stuff. I posted it this morning (6/8/2024 4:21 Central time USA) Cheers Chris
@michaelangellotti5741
2 ай бұрын
@@MakingStuffwithChrisDeHut No worries. Many thanks.
>> 11:38
@MakingStuffwithChrisDeHut
2 ай бұрын
Oh boy, Indian food can be "interesting", be careful. Pizza was great as always :-) Cheers! Chris
@tomek3633
2 ай бұрын
@@MakingStuffwithChrisDeHut it was hot and it was spicy and suuuuuper delicious :)
@MakingStuffwithChrisDeHut
2 ай бұрын
@@tomek3633 You are a brave man eating that hot and spicy food! My body doesn't take kindly to it ;-) Cheers! Chris
@tomek3633
2 ай бұрын
@@MakingStuffwithChrisDeHut 😂
Micropython's garbage collector loses track of stuff and leaves tiny bits of garbage distributed throughout RAM. You can call gc.collect() all you want. Soon you can't allocate a one kilobyte array even if you've got 90% free memory.
@MakingStuffwithChrisDeHut
2 ай бұрын
Thanks for the additional information! I have not run into anything like that - YET, but I suspect that problem is "just around the corner"! Cheers! Chris
@mattytrentini
Ай бұрын
Have you got any evidence of that? We've run simulated *years* of testing (actually performed over a couple of months) on some medical devices and have not seen this occur. Of course, we watched what the allocations looked like to ensure we weren't fragmenting memory...MicroPython never lost track of anything but it can - like any GC - fragment.