Skip to content

Memory leak for native machine code in mpy files #6045

@pmvr

Description

@pmvr

I noticed a memory leak in the usage of native mpy files.

Even for the simple example given in the documentation the following code demonstrates the issue:

import factorial
from urandom import randint
import gc

for i in range(100000):
    c = factorial.factorial(randint(4, 15))
    print(gc.mem_free())
    print(i, c)

I tested this with

MicroPython v1.12 on 2019-12-20; PYBD-SF2W with STM32F722IEK

on a Pyboad D-series.

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