Skip to content

Check memory use #3

@tannewt

Description

@tannewt

I suspect this uses a lot of memory because of all variable names are stored unless they start with _, are const and run through mpy-cross. Here is an example: https://github.com/pimoroni/Pimoroni_CircuitPython_LTR559/blob/master/pimoroni_circuitpython_ltr559.py#L97

A crude way to measure memory is:

import gc
print(gc.mem_free())
import pimoroni_circuitpython_ltr559
print(gc.mem_free())

This will print the free memory before and after import.

I'd also suggest doing further mods as PRs to this repo even if you merge right away. It dives me something to comment on then with suggestions.

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