How to view the allocation of native and graphics memory in Android studio 3.0

When I analyze app memory in Android studio, I can see the consumption of different types of memory,

But when I dump the Java heap (middle button), I only get the allocation of the heap,

This is the expectation of the button name. But so far, I can still see the allocated char array and string, but as we know in the recent version, the char array from string is moved to the native heap, and the string class can only access them through native methods, so it turns out that this heap dump shows that there is still a native heap. Am I right? How about the graphics heap?

resolvent:

Although it is not an authoritative source in any way, I and others try to explain JAVA memory use here. As far as I know (someone working with art or davlik can give you a clearer answer) only one heap can be used for the whole application, and there is no specific graphics heap

Android Studio may show you how many heaps consumed by graphics operations. It is similar to how Stack (green) memory segments display contents that are currently consumed by the current call stack. You can see how the code reflects this situation by highlighting the subdivision.

When using this view, you should remember to select the application heap from the drop-down list:

The native and Java segments show how much memory is allocated directly through the SDK / Java framework and how much memory is allocated locally through the underlying structure. (they don't display different memory areas in your application, which looks confusing - see the last link)

The best overview of what profiler shows you is in developer documentation, which also outlines the impact of system image and zygote heap on you

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>