This feature keeps track of the per task peak memory usage.
- Update the heap_task_tracking example to make use of the new feature
Cleanup the implementation:
- multi_heap_get_free_size() is never used, remove it.
- Minor update in heap_caps_update_per_task_info_xx() funcitons.
- Update settting on block owner in heap_caps.c to work with the
get peak usage feature.
- Update heap_caps_update_per_task_info_free() to detect when it
is called to delete the memory allocated for a task TCB. Mark
the corresponding task in the statistic list as deleted.
- Add a Kconfig option dependant on HEAP_TASK_TRACKING being enabled
that force the deletion of the statistics related to deleted task
when set to true.
- In task tracking feature, add a current and peak memory usage
to the heap_stat_t structure to keep track of the current and
peak memory usage of the given task across all heaps.
- Fix missing block owner when allocating memory for heaps_array
in heap_caps_init.
- Keep the original implementation of the task tracking
for backward compatibility reasons.
In esp32c2 and esp32c61 memory_layout.c files, the config used to allow
MALLOC_CAP_EXEC was CONFIG_ESP_SYSTEM_MEMPROT_FEATURE when
CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT should be used.
Closes https://github.com/espressif/esp-idf/issues/14836
- Place the section on alloc failed hook at a better place
- Add reference to the different poisoning configs at the beginning
of the heap corruption detectino section
- Update the information concerning heap tracing
- Update the heap tracing log examples
- Fix heap tracing standalone code:
- Update the logging format in heap_trace_dump_base
- Add freed field in trace stucture to keep this info even
when no call stack is available
Create a specific group "psram" to only run meaningful
tests on the sdkconfig.ci.psram and sdkconfig.ci.psram_all_ext
configuration.
Add test testing that external memory is prioritized when using
MALLOC_CAP_DEFAULT.
The new TLSF architecture has changed. tlsf.h public API
header is now moved into an include folder. tlsf_common.h
is removed from the repo.
This commit updates the heap component and respective
esp_rom patches to take into account this new
architecture.
The implicit promise of heap_alloc_caps() and friends is that the memory it
returns is fit for the purpose as requested in the caps field. Before
this commit, that did not happen; e.g. DMA-capable memory wass returned
from a correct region, but not aligned/sized to something the DMA subsystem
can handle.
This commit adds an API to the esp_mm component that is then used by the
heap component to adjust allocation alignment, caps and size dependent on
the hardware requirement of the requested allocation caps.
This commit adds a feature to pause the heap tracing in the
sense that in this state, the heap tracing will no longer
record the new allocations but will continue to monitor
the free() in order to keep track of the status of the
allocations present in the list of records.
See https://github.com/espressif/esp-idf/issues/13803
Add a test to make sure that the task handles returned in the
task tracking information are valid task handles.
To verify that, feed the task name returned by pcTaskGetName()
using the task handle under test to xTaskGetHandle() and make
sure the task handle returned matches the one under test.
This return value is used by the tlsf_walk_pool
function to be notified of the need to interrupt
the ongoing traversal of the currently traversed
heap.
Introduce new APIs in essp_heap_caps.h:
- heap_caps_walk()
- heap_caps_walk_all()
Those functions are triggering a callback for all blocks
(allocated or free) of memory present in heaps meeting
the set of capabilities passed as parameter (or all heaps
for heap_caps_walk_all() function)
test_walker.c added to test the new functionality in
test_apps/heap_test/
Implement a function to start tracking the minimum free size from the
moment the function is called.
Implement a function to stop tracking the minimum free size and restore
the minimum free size value calculated since startup.
Implement the tests related to this new feature.
- Add sdkconfig.ci.task_tracking that runs generic tests
with heap task tracking enabled.
- Add task_tracking.c that includes a test checking that
a created task that allocates memory is added to the list
of task tracked by the heap task tracking feature.
The integrity_walker now calls the integrity check hook to control
free AND used blocks of memory in the TLSF pool. This integrity walker
function is called from tlsf_check_pool.
This commit creates a patch of integrity_walker function to update the
outdated implementation in the ROM.
Previously, the hash map was a doubly linked list but was never
using the characteristics of it.
This commit switches the hash map to a singly linked list instead
This commit also fixes memory leak in heap trace tests by setting
hashmap size to 10 for the tests (instead of the default value of 250)
See https://github.com/espressif/esp-idf/issues/11173
This commit updates the tlsf submodule to include the modification made in the component
aiming to perform integrity check on all blocks (not only the free ones).
Added test to test the fix in test_apps/heap_tests.
Fixes https://github.com/espressif/esp-idf/issues/12231
- Remove the size limit for the hash_map array from the CONFIG_HEAP_TRACE_HASH_MAP_SIZE
- Add test case for heap tracing using hashmap
- Update heap_debug.rst to document the newly added configurations in the heap component
Closes https://github.com/espressif/esp-idf/issues/11172
Add test configuration to run all tests with heap component in the flash.
Add reference to this new configuration in performance section of the documentation.