I started having memory allocation errors once I tried porting my code to use the new uasyncio module AIOESPNow.
MemoryError: memory allocation failed, allocating 4224 bytes
This happens even if I have no espnow code and I just import the module in the context of my application like so:
import aioespnow as espnow
If I comment the import line and run micropython.mem_info()
I get this:
GC: total: 64000, used: 42480, free: 21520
,
21520 bytes should be plenty no?
Without any code loaded, the REPL gives me this when running micropython.mem_info():
GC: total: 64000, used: 6256, free: 57744
If I then import aioespnow I get:
GC: total: 64000, used: 12016, free: 51984
Roughly 6kb doesn't seem like a lot, but if the import happens in the context of the application, it crashes and I have no idea why yet.
Any clues on what might be happening? I know that it's not much to start with but I appreciate any insights.
Thank you.