whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.18k stars 221 forks source link

curl #371

Closed antocala closed 2 years ago

antocala commented 3 years ago

hi, i'm trying to use the method net.curl.get after connecting to a vpn server with esp, but i'm given a memory error

`net.curl.get("http://IP:port")

curl_easy_perform failed: Out of memory false Out of memory error`

what i was wondering is if there was any command to free esp memory or something similar to solve this problem. Thanks

jolivepetrus commented 3 years ago

@antocala,

You can try to force a lua garbage collection cycle before call curl:

collectgarbage()

antocala commented 3 years ago

I have tried but I always get the same error.

the collectgarbage() call comes back to me with value 0.

the0ne commented 2 years ago

Hi @antocala if there is not enough memory on the board you use, you could try using a board with integrated PS-RAM. Else, there's not much you could do except using garbage collection.