mobizt / Firebase-ESP32

[DEPRECATED]🔥 Firebase RTDB Arduino Library for ESP32. The complete, fast, secured and reliable Firebase Arduino client library that supports CRUD (create, read, update, delete) and Stream operations.
MIT License
415 stars 118 forks source link

HELP: How much heap should this take? #113

Closed jshep321 closed 3 years ago

jshep321 commented 3 years ago

I have observed about 40k heap consumed (and freed up after .end) in my application. Is this expected?
(ESP32-WROOM32)

Thanks!

About to .end firebase
xPortGetFreeHeapSize :134324
After firebase.end
xPortGetFreeHeapSize :175096
mobizt commented 3 years ago

It depends on the memory used by embedTLS and SSL client and other dynamic allocations, you should test it yourself. The currently available of heap from freed resources may be varied. The dynamic allocation are completely freed when the end function was called. The memory used by mbedTLS are freed also.

jshep321 commented 3 years ago

I did test per the above. I was posting here to get some other inputs, but I guess I won't see them since this is closed already.

mobizt commented 3 years ago

I already explain it above and you will not get the exactly free heap as there also used by system task unless you turn off all internal system tasks which the library depends on.

This is private repo which the opened issue should be a problem in usage or bugs or any improvement.

mobizt commented 3 years ago

If you are wonder of the heap usage of 40k, this is normal as most of memory allocation in the library used by mbedTLS and TCP client(lwip). The dynamic memory allocation is based on the response payload which always keep as long as no new http request.

You can test the amount of memory used by mbedTLS by using WiFiClientSecure to create https connection to some server (via port 443).