Does esp32 has garbage collection?

TimoFran
Posts: 3
Joined: Sat Mar 26, 2022 3:18 pm

Does esp32 has garbage collection?

Postby TimoFran » Fri Apr 05, 2024 5:08 pm

Hi all!
I'm running a simple esp32 program which reports free heap and min free heap (no real need but I liked that).

What I found is that at a certain point the min_free_heap went from about 1.82kb to about 62.5kb while the total free heap remained the same.

I'm getting the values using ESP.getFreeHeap() and ESP.getMinFreeHeap().

Can someone please explain why does the min free heap increased? I tought this could not happen.
Attachments
Screenshot 2024-04-05 at 19-06-54 ML0006 - Dashboards - Grafana.png
Screenshot 2024-04-05 at 19-06-54 ML0006 - Dashboards - Grafana.png (71.68 KiB) Viewed 1476 times

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: Does esp32 has garbage collection?

Postby liaifat85 » Sat Apr 06, 2024 2:16 pm

It's possible that earlier in the program execution, the free heap dropped significantly lower than 62.5kb, and that was recorded as the min_free_heap value at that time. Then, as the program continued to run and memory was freed up, the min_free_heap value was not updated because the minimum threshold was never breached again.


Who is online

Users browsing this forum: No registered users and 57 guests