Skip to content

Commit

Permalink
Merge branch 'feature/heap-trace-hash-map' into 'master'
Browse files Browse the repository at this point in the history
heap: Add hash map mechanism to lower the access time to trace records

Closes IDFGH-9425

See merge request espressif/esp-idf!22564
  • Loading branch information
SoucheSouche committed Apr 5, 2023
2 parents ab18f98 + 14fa303 commit f94bbe1
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 103 deletions.
24 changes: 24 additions & 0 deletions components/heap/Kconfig
Expand Up @@ -70,6 +70,30 @@ menu "Heap memory debugging"
This function depends on heap poisoning being enabled and adds four more bytes of overhead for each block
allocated.

config HEAP_TRACE_HASH_MAP
bool "Use hash map mechanism to access heap trace records"
depends on HEAP_TRACING_STANDALONE
default n
help
Enable this flag to use a hash map to increase performance in handling
heap trace records.

Keeping this as "n" in your project will save RAM and heap memory but will lower
the performance of the heap trace in adding, retrieving and removing trace records.
Making this as "y" in your project, you will decrease free RAM and heap memory but,
the heap trace performances in adding retrieving and removing trace records will be
enhanced.

config HEAP_TRACE_HASH_MAP_SIZE
int "The number of entries in the hash map"
depends on HEAP_TRACE_HASH_MAP
range 1 10000
default 10
help
Defines the number of entries in the heap trace hashmap. The bigger this number is,
the bigger the hash map will be in the memory. In case the tracing mode is set to
HEAP_TRACE_ALL, the bigger the hashmap is, the better the performances are.

config HEAP_ABORT_WHEN_ALLOCATION_FAILS
bool "Abort if memory allocation fails"
default n
Expand Down

0 comments on commit f94bbe1

Please sign in to comment.