I created a sample app and ran the Android Profiler. Just before getting a Java/Kotlin memory dump, I saw these numbers:
However, in the memory dump window I see these:
Let's take a look at the numbers:
Native equals to 4.6 MB before the dump, and in the dump I see the native size equals to 92,041 or 91 kB (app heap) and 505,895 or 505 kB (all heaps). Neither of them is close to 4.6 MB. So I wonder how the graph numbers and the numbers in the heap dump are related.
Similarly, I don't understand how the retained size values from the dump are related to Others, Code, Stack, Graphics and Java in the timeline.



Here is my assumption. The Memory Overview article says:
and the explanation of how memory is counted contains:
So the app heap value of 8,372,986 (or ~8.3 MB) I saw included both dirty and clean pages that are shared with other processes whereas 5.4 MB of Java memory from the first screenshot includes private memory pages that my app has committed, according to the Android system. This count does not include pages shared with the system or other apps.