-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v5.1] [Heap Trace Standalone] support external memory for hash map (IDFGH-9845) #11172
Comments
Also, while we are at it, I would set the maximum hashmap size to 200k, not 10k. After boot, I can have 20k live allocations, so I need ~30k hashmap. |
Also, IMO, the map should not be allocated until you initialize heap trace standalone, perhaps with a log statement saying how much memory is being allocated. No need to waste memory doing nothing. |
Hi @chipweinberger, I started working on your follow up issues (this one and #11173) today. I will let you know when they are ready and reviewed. Maybe one remark on your comment about the hashmap size. With a hashmap array of 10K entries, if you have 20K allocations, if we consider the repartition of the calculated hashes to be homogenous across the range of array entries, it means that each list in the array would have 2 elements. I can increase the maximum number of lists in the hashmap array but in your case for example, with an array of 30k entries, you will statistically only use 66% of it given the 20k of live allocations you mentioned. In addition, each used entries will have only 1 element in the list which will probably result in lower perf. With less entries and more elements in each list, your perf will be better when using the |
This would be surprising to me. List traversal is slower than a single array lookup. Still, I think 10K is too low as a maximum. Perhaps 50K at least... |
I will increase the size to 100K and fix the external memory issue. Also, another heap related feature will be merged soon and will allow you to store the entire heap component in flash thus saving quite a bit of internal memory but lowering the overall performances of the component. |
@chipweinberger, the feature was reviewed and approved :) So it should be merged into master today hopefully. In the end I removed the limitation concerning the size of the hash_map. |
Great! awesome. |
Was I also able to convince you to allocate the ram at That would be ideal imo for enabling leak diagnostics at runtime (my use case). |
@chipweinberger sorry but the memory will be allocated at compile time. |
… RAM bss section when possible - 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 #11172
@SoucheSouche
Thanks for all your work on #10793.
I noticed that the hash map no longer supports external memory. I wont be able to use the hash map in my project without it as I don't have very much spare internal RAM. =(
Can you please add support for external ram?
The text was updated successfully, but these errors were encountered: