Skip to content

version 1.0 memory leak #101

@goodeb

Description

@goodeb

The attached code triggers a memory leak in firmware version 1.0 by re-instancing PicoVector in each loop. Manually running garbage collection doesn’t help. A summary of the output is below.

At count 1
percent memory free: 93.4622
after collect percent memory free: 93.4997
At count 2
percent memory free: 92.795584
after collect percent memory free: 92.81434
...
At count 136
percent memory free: 0.95678576
after collect percent memory free: 0.9755385
At count 137
percent memory free: 0.27142158
after collect percent memory free: 0.29017434

After this the Presto freezes while still displaying 136 . You can workaround this bug by taking the line vector = PicoVector(display) out of the loop, but the same code runs fine under firmware version 0.1 with the following output. It continues to run under 0.1 even without the gc.collect()

At count 1
percent memory free: 93.51263
after collect percent memory free: 94.22905
At count 2
percent memory free: 93.53123
after collect percent memory free: 94.22905
At count 3
percent memory free: 93.53123
after collect percent memory free: 94.22905
...

reproduce_bug.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions