Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryError: memory allocation failed #7

Closed
chaseadam opened this issue Oct 24, 2022 · 0 comments
Closed

MemoryError: memory allocation failed #7

chaseadam opened this issue Oct 24, 2022 · 0 comments

Comments

@chaseadam
Copy link

I noted this was originally written for targets including ESP32, but I am having trouble with memory allocation errors on micropython 1.19.1 (possibly older versions as well). It chokes on py files less than 26KB.

>>> OTA.fetch()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/senko.py", line 74, in fetch
  File "/lib/senko.py", line 53, in _check_all
  File "/lib/senko.py", line 45, in _get_file
  File "urequests.py", line 28, in text
  File "urequests.py", line 20, in content
MemoryError: memory allocation failed, allocating 12288 bytes

I have had some success in the past using gc.collect() to help remedy memory allocation failures and even modified the _get_file() method to collect before the urequests.get(). SSL connections (using mbedTLS) has severe limitations with micropython due to limited IDF heap available and even is unusable in later versions of the ESP IDF due to memory allocation behavior (micropython/micropython#8940).

From what I can tell, this is not IDF heap related and I am running out of python memory. I moved the senko check in boot.py (before main application imports and init) and it is functioning as expected without error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant