033 DON'T LET MICROPYTHON'S GARBAGE COLLECTOR RUIN YOUR PROGRAM

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • 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

  • @nigelworwood8530
    @nigelworwood8530 4 месяца назад +1

    No garbage here. Another interesting and informative video. Thanks.

  • @larryplatzek9017
    @larryplatzek9017 4 месяца назад

    Still no download for 033, hope will be posted soon.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  4 месяца назад

      Thanks for letting me know. I also got the site updated for Episode 34
      Cheers!
      Chris

  • @tomek3633
    @tomek3633 4 месяца назад

    >> 11:38

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  4 месяца назад +1

      Oh boy, Indian food can be "interesting", be careful. Pizza was great as always :-)
      Cheers!
      Chris

    • @tomek3633
      @tomek3633 4 месяца назад

      @@MakingStuffwithChrisDeHut it was hot and it was spicy and suuuuuper delicious :)

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  4 месяца назад +1

      @@tomek3633 You are a brave man eating that hot and spicy food! My body doesn't take kindly to it ;-)
      Cheers!
      Chris

    • @tomek3633
      @tomek3633 4 месяца назад

      @@MakingStuffwithChrisDeHut 😂

  • @michaelangellotti5741
    @michaelangellotti5741 4 месяца назад

    Is 033 source code posted? Didn't see it on the bottom of the list.

    • @MakingStuffwithChrisDeHut
      @MakingStuffwithChrisDeHut  4 месяца назад +1

      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
      @michaelangellotti5741 4 месяца назад

      @@MakingStuffwithChrisDeHut No worries. Many thanks.

  • @jasontiscione1741
    @jasontiscione1741 4 месяца назад

    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
      @MakingStuffwithChrisDeHut  4 месяца назад

      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
      @mattytrentini 3 месяца назад +1

      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.