This repository was archived by the owner on Mar 17, 2025. It is now read-only.
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
How to release memories in loop() if I use Firebase only in setup() #251
Open
Description
Example, I have a program with below struct:
void setup()
{
checkFree(); //#check 1
Firebase.getString(.....);
Firebase.push(.....);
Firebase.push(.....);
checkFree(); //#check 2
}
void loop()
{
checkFree(); //#check 3
//Do something but do not use Firebase continue
}
When I check free memory by function ESP.getFreeHeap():
#check 1: Free 34504
#check 2: Free 15816
#check 3: Free 16040
It's waste memory in loop().
How to delete Firebase or release memories?
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
tackelua commentedon Mar 4, 2017
Have someone help me? 🥇
If I don't use libraries, do Firebase have http api to send data to database?
[-]How to release memory in loop() if I use Firebase only in setup()[/-][+]How to release memories in loop() if I use Firebase only in setup()[/+]proppy commentedon Apr 10, 2017
Seems similar to #252
FirebaseHttpClient
#252proppy commentedon Jun 15, 2018
Sorry for the late follow-up: I wonder if this was fixed with esp8266/Arduino@bf5a0f2 ?
yhua537 commentedon Aug 28, 2018
Using SDK2.4.2 and checking the free heap on each all, the memory come down to a stable value, however, is it possible to free it completely as requested by @tackelua ? it is actually related to #28 which merged from #375.
I was also attempt to end the connection by calling end() but doesn't seem to have any impact, any idea how to do it?
yhua537 commentedon Jan 24, 2019
Just found a working workaround, which i don't really like: add a new function to end the connection by setting the httpclient with timeout to 1 and do a empty sendrequest which will force the connection to fail, it will release the heap, this solution. However, only works with Arduino 2.4.2. Try that on 2.5.0, it doesn't work.
There is some setting in the library stopping the httpclient to free the resource. As i try a normal httpclient request, when it finished, I will free the heap. @proppy , do you know what it is let httpclient hold on to the connection/heap?