Memory management question and odd behavior with larger files #9550
GM-Script-Writer-62850
started this conversation in
General
Replies: 1 comment 13 replies
-
This behavior is caused by memory fragmentation (see https://forum.micropython.org/viewtopic.php?t=1260 for a discussion).
|
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using a PICO W with rp2-pico-w-20220923-unstable-v1.19.1-443-g30e50ab19.uf2
I noticed some strange behavior when opening/closing files and running
gc.collect
after and checkinggc.mem_free
lets say i open a file of say 3457 bytes and dump it over http and look at my ram then clean it up and look again, the space look to have been freed up that i just used, however if i open say 70294 bytes and assuming i do not run out of ram the ram does not get freed as I expected based on the test with the smaller file
i am/was opening files like this
Sometimes i have have ~100K free and run out of ram opening a ~70K file:
MemoryError: memory allocation failed, allocating 41472 bytes
how am i only getting ~41K when asking for ~70K when i have ~100KBeta Was this translation helpful? Give feedback.
All reactions