I am working on an Android application and I have a memory dump (i.e. a .hprof file) that I captured from my application.
I want to investigate a certain container of the application.
Just like an ArrayList, the container has a growth policy that increases the capacity of the container when the size is reached to guarantee constant amortized time cost for adding elements into it.
My hypothesis is that every instance of the container possesses multiple unused allocated memory spaces.
I want to automate the process of investigating this case. Is there a way to write a script that can parse this .hprof file and return the ratio of these unused allocated spaces to total_entries?
Thank you!