Description
Getting the following exception:
memory allocation failed, allocating 32763 bytes
I have a bit more than 3X memory free at the time of making the call to response.text().
What I've found is that each pass through the iter_content
loop is consuming 2X chunk_size
(so 2X the content in total) and then at the self.close()
another allocation happens for the full content size, where it throws the exception. Unclear to me if that's coming from .close
or from the .join
in content
:
I've found that increasing the chunk_size
to 64 gets me working at a cost of 2.5X chunk_size
per pass through the iter_content
loop (but half as many passes).
First observed on Adafruit CircuitPython 8.2.10 on 2024-02-14; Raspberry Pi Pico W with rp2040
Also reproduced on Adafruit CircuitPython 9.0.2 on 2024-03-28; Raspberry Pi Pico W with rp2040