Description
Hi, I just answered a Reddit issue where somebody has some very trivial code in a loop, and it runs out of memory after a while, the reddit page is here:
https://www.reddit.com/r/raspberrypipico/comments/12v8k0a/oserror_errno_12_enomem/?sort=new
I walked through the code and on line 93 of urequests.py, there is an allocation taking place in wrap_socket(), assigned to s and then not seemingly released after s.close() has been called. I have only looked at the code for aobut half an hour so it's entirely possible the deallocation is done somewhere else but wrap_socket returns a handle to the memory, that's s
, and there seems to be no corresponding call to free it.
https://github.com/micropython/micropython-lib/blob/master/python-ecosys/urequests/urequests.py