Hi all,
I am testing an application that we collect wifi information from ESP32, then encode in JSON format, then send to cloud server in the 1 minute-interval.
However, after about 30 minutes, we received an error from cJSON APIs, then I can not do the encoding anymore.
I did some debugging, the program always stopped at some cJSON APIs related to create cJSON object (number or string) after running about 30 minutes.
At first, I did not think it is the memory leak issue, because in each encoding task, I always use these two below functions to free the memory.
cJSON_PrintPreallocated()
cJSON_Delete()
As I know, the cJSON_Delete is using the k_free() function to free memory, I did an experiment with k_free(), and I see that k_free() did not work as expected.
It could not free memory allocated by k_malloc()
My environment is NRF9160 and SDK ver 1.3
Could you help me to overcome this issue ?