Hi
I am working on memory leak analysis in esp32. I am facing problem with heap_trace_record_t type buffer, this will record the leaks and prints when heap_tracing is enabled in menuconfig. But this buffer is overflowing, can anyone tell me how to increase the buffer size to record more leaks.
I tried by changing the value assigned to that buffer in library file but still i am getting 14 allocation record not more than this. please reply me as soon as possible.
log :
1736 bytes 'leaked' in trace (14 allocations)
total allocations 17222 total frees 17275
(NB: Buffer has overflowed, so trace data is incomplete.)
MALLOC_CAP_8BIT critical leak: Before 242052 bytes free, After 229160 bytes free (delta 12892)
Thanks and Regads
Nayana
How to increase number of records in heap_tracing buffer heap_trace_record_t?
Re: How to increase number of records in heap_tracing buffer heap_trace_record_t?
Hi Nayana,
The buffer is allocated in the application code which initialises & enables heap tracing. If you look at the example in the docs (scroll down a small way from the linked heading), you'll see there is a macro NUM_RECORDS which is used for the size of the "trace_record" array and also passed to heap_trace_init_standalone(). If you change this macro then the number of records used in the buffer will also change.
If you're still running out of buffer while trying to leak check, check you're using heap_trace_start(HEAP_TRACE_LEAKS) - starting in "ALL" mode records every allocation and there can be a lot of these! LEAKS mode will delete an entry from the buffer after the memory is freed.
Angus
The buffer is allocated in the application code which initialises & enables heap tracing. If you look at the example in the docs (scroll down a small way from the linked heading), you'll see there is a macro NUM_RECORDS which is used for the size of the "trace_record" array and also passed to heap_trace_init_standalone(). If you change this macro then the number of records used in the buffer will also change.
If you're still running out of buffer while trying to leak check, check you're using heap_trace_start(HEAP_TRACE_LEAKS) - starting in "ALL" mode records every allocation and there can be a lot of these! LEAKS mode will delete an entry from the buffer after the memory is freed.
Angus
Re: How to increase number of records in heap_tracing buffer heap_trace_record_t?
Thank you for your reply, i will try this solution.
Regards
Nayana
Regards
Nayana
Who is online
Users browsing this forum: jtroncin21 and 138 guests