Description
CircuitPython version
Adafruit CircuitPython 9.0.0-alpha.6 on 2023-12-12; Raspberry Pi Pico W with rp2040
Code/REPL
import gc
print("Before import", gc.mem_free())
try:
import adafruit_datetime
# from adafruit_datetime import datetime
except Exception as e:
print(e)
print("After import", gc.mem_free())
Behavior
Importing some libs on 8.2.9 works as expected, and allocates only a small portion of memory, the same code/imports on 9.0.0-alpha6 errors with MemoryError
, and despite not importing the module uses nearly all available memory.
From my testing this does not happen on ESP32-S2, but maybe this is due to the higher amount of memory on these boards.
Description
Importing whole library on 8.2.9.
Importing only datetime
class on 8.2.9.
Importing whole library on 9.0.0-alpha6.
Importing only datetime
class on 9.0.0-alpha6.
Notice how despite not importing the lib successfully, the gc.mem_free()
returns a 4k (I guess bytes).
Additional information
My guess is, CircuitPython 9.x.x changed something regarding memory allocation. I was able to find this live from Adafruits YT channel, when they show something that looks like the problem presented here.