I wrote some code using the nativ NON-OS SDK 2 and mbedtls to poll sensor-data and send them to an Influx-DB using HTTPS. On of the measurements is the free heap as reported by system_get_free_heap_size(). As you can see in the attached image the free heap wobbles between 45 and below 25K. Sometimes it ramps down and recovers after a while. Looks like a garbage collection. As I do the same stuff all the time it is unlikely my code. Also I cannot see any errors or stuck processes on the serial console. I poll NTP every 10 seconds and I poll the sensors every minute, prepare the update and send it using HTTPS. No errors, same timing measured using a stop-watch and the output on the serial console and the influx-db logs. But different heap-usage all the time. I would not mind that, but if the heap lowers to 25K or below HTTPS wont run any more and I need to implement something like a software reset.
Any hints how to track this down? Or run the "garbage collection" more often to keep heap above 25K for sure?