ESP32-S3 heap decreases after Firebase Stream reconnects even with PSRAM enabled #306
-
|
Hello everyone, I’m investigating a progressive internal heap decrease on ESP32-S3 related to Firebase Stream reconnects, and I’d like to share exact code and log evidence to better understand whether this behavior is expected or avoidable. 🔧 Environment MCU: ESP32-S3 N16R8 (8MB PSRAM) Arduino core: 2.0.14 Firebase ESP Client: 4.4.14 TLS: BearSSL PSRAM: enabled (compile-time & runtime) All Firebase SSL RX/TX/response buffers are successfully allocated in PSRAM. 🔁 Stream Lifecycle (Code) This is the exact reconnect sequence used in my project: void stopFirebaseStream() { void startFirebaseStream() { Heap is measured before cleanup, after cleanup, and after reconnect. 📊 Heap Measurement Code startFirebaseStream(); Serial.printf( 🔄 Starting Firebase stream... This loss is permanent. After multiple reconnects: Reconnect #1 → -8 KB After 3–4 reconnects, the device must be restarted to recover heap. 💾 PSRAM Status This indicates the loss happens in internal heap, not PSRAM. 🧠 Observations Same FirebaseData stream object is reused Stream is not recreated, only ended and restarted No dynamic allocations in user stream callback JSON payload sizes are small Heap loss happens even if no stream data is received ❓ Questions Is this heap loss expected due to TLS / BearSSL reconnect behavior? Is Firebase.RTDB.endStream() expected to fully release internal memory? Is there a recommended stream reconnect pattern on ESP32-S3? Would keeping the stream alive (without calling endStream) be safer? Any clarification or best-practice guidance would be greatly appreciated. Thanks in advance. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
That library you are mentioned is end of life and no further supports. |
Beta Was this translation helpful? Give feedback.
That library you are mentioned is end of life and no further supports.