whitecatboard / Lua-RTOS-ESP32

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

fixed crash in ip_input #283

Closed the0ne closed 5 years ago

the0ne commented 5 years ago

must not delete the task while it's inside tunif_input now openvpn looks pretty stable. but it's losing memory.

the0ne commented 5 years ago

now that the "tun" task issue finally seems fixed, the picture gets clearer. every few minutes openvpn reconnects due to inactivity. every reconnect increases openvpn's heap usage by as much as ~6.7 kbytes

the0ne commented 5 years ago

the small memory "leaks" seem come from the fact that openvpn, when auto-reconnecting keeps it's list of options and only adds the push-options - that it receives from the server each time it connects - to the end of that options-list. out of that options-list it assigns the values to it's pointers.

that is bad for us because it uses precious memory, but it seems that's not what takes 6k of memory each time but rather a few hundred bytes.

the fact that the missing heap memory is not shown might be caused by it being allocated by some other component that's used by the openvpn thread. looking into mbedtls might be a good guess.

after having stopped the openvpn thread - that had done one reconnect - when it's done with cleanup and has exited, there's 15 blocks of heap with a total of 7100 bytes that's lost.

the0ne commented 5 years ago

@jolivepetrus I cannot currently spend more time on openvpn so please merge as-is.