Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Suggesting to free and return heap resource once connection is completed [duplicated to #28] #375

Closed
yhua537 opened this issue Aug 14, 2018 · 5 comments

Comments

@yhua537
Copy link

yhua537 commented Aug 14, 2018

While reuse the connection is a good idea for CPU performance, ESP82666 has limited heap resource, #3740 & #4089 Firebase library currently holding over 16k when the first connection is active, plus the other heap space consumed by SDK, available free heap is very limited for user program.

Suggesting to trade off some CPU performance and defaulting to close the connection once the request is completed (unless it is under stream mode), or at very least, providing API to allow manual close of the connection.

@yhua537
Copy link
Author

yhua537 commented Aug 14, 2018

Checking on other issues, it could be duplicate to #251, had very similar issue in the past, IMHO that's because SDK dose not actively close connections unless the other device/server close it first.

@proppy
Copy link
Contributor

proppy commented Aug 16, 2018

@yhua537 IIRC there is a fair amount of overhead into initializing the HTTP connection (like NNN ms) so reuse it for subsequent operation allow for only the first operation to take the latency hit.

Maybe we could have an explicit end() and implement something like #28 so that .begin() also warm up the connection. What do you think ?

@yhua537
Copy link
Author

yhua537 commented Aug 16, 2018

Begin() is currently used to initialize the parameter which is not really begin of the client being run.

Yes, I like the idea of having explicit begin()/end() to run/stop the connection to allow more control to tune the limited resource base on our need/system.

@proppy
Copy link
Contributor

proppy commented Aug 16, 2018

@yhua537 updated #28 to add your suggestion. Making this as a duplicated.

@yhua537
Copy link
Author

yhua537 commented Aug 16, 2018

@proppy , thanks, happy with that solution.

Closing this as duplicate to #28.

@yhua537 yhua537 closed this as completed Aug 16, 2018
@yhua537 yhua537 changed the title Suggesting to free and return heap resource once connection is completed Suggesting to free and return heap resource once connection is completed [duplicated to #28] Aug 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants