Conversation

Since I was already working on implementing stats (twitter.com/DanielMicay/st), I also implemented Android's internal extensions to jemalloc for providing stats to Bionic: github.com/GrapheneOS/har Bionic uses these four functions to implement Android's public malloc_info API.
Quote Tweet
Android Q uses mallinfo as part of the ART GC for better integration with native code: developer.android.com/preview/featur. Commits: android.googlesource.com/platform/art/+ android.googlesource.com/platform/art/+ I added an actual implementation to hardened_malloc in preparation for moving to Q: github.com/GrapheneOS/har
Show this thread
1
3
It provides structured output divided up at the top level based on arena, showing the total memory allocated for small, large and huge allocations along with each of the size class bins for the arena and a counter of total allocations / deallocations for each arena. It fits well.
1
1
I can certainly implement the malloc_iterate API, but it would be very inefficient with the current open addressed hash table used for tracking large allocations. I already want to offer an alternative able to answer malloc_object_size queries within large allocations anyway.