Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

When debugging a project I stumbled upon a problem and can't seem to understand it really.

When running the following simple example with MICROPY_DEBUG_VALGRIND (1) and valgrind, the garbage collector won't do automatic collection and I run out of memory. If I try to force a collection using gc.collect() I get an invalid read and a termination.

import gc
import array
import micropython   
while True:
    frame = array.array('i', (i for i in range(512)))
    micropython.mem_info()
    gc.collect()

Output when trying to force a collection while running with valgrind:
Screenshot from 2024-03-15 11-11-03

Output when not trying to force a collection:
Screenshot from 2024-03-15 11-17-39

Is this expected behavior or is there a way to run my programs with valgrind and an active garbage collector?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.