ThatCampbellKid
ThatCampbellKid

Reputation: 533

Android Studio - Emulator Profile and Device Profile VERY different

I came across this while asking a different question, why does the Android Emulator show such a different performance profile than a comparable device profile?

Specifically, the device calls a huge graphics section that is not visible on the emulator... is there a reason for this?

Device - 26api - 48Mb device 26api

Emulator (Pixel2) - 26api - 24Mb - Hardware Graphics 26api

Emulator (Pixel2) - 26api - 54Mb - Software Graphics 26api

Device - 24api - 52Mb device

Emulator (Pixel2) - 24api - Hardware Graphics - 15Mb pixel2

Emulator (Pixel2) - 24api - Software Graphics - 40Mb pixel2 software

Device - 22Api - 50Mb device2

Emulator (Pixel2) - 22api - Hardware Graphics - 14Mb pixel2 22

Emulator (Pixel2) - 22api - Software Graphics - 40Mb pixel2 22

Upvotes: 2

Views: 1670

Answers (1)

Crammeur
Crammeur

Reputation: 688

This depend on how your configure Emulator if you a good amount of RAM with HAXM.

This can improve your performance app have less System.gc() if Emulator RAM is more than Device.

But is not the only things and you can configure your HAXM acceleration HAXM acceleration Doc.

Explaination

Without acceleration, the emulator takes the machine code from the VM and translates it block by block to conform to the architecture of the host computer. This process can be quite slow. But, if the VM and the architecture of the host computer match (such as x86 on x86), the emulator can skip translating the code and simply run it directly on the actual CPU using a hypervisor. In this case, the emulator can approach the speed of the host computer.

Explaination 2

When you create an Android Virtual Device (AVD) in the AVD Manager, you can specify that graphics acceleration occur in hardware or software to emulate the GPU of the virtual device. Hardware acceleration is typically faster. Software acceleration is useful if your computer uses graphics drivers that aren't compatible with the emulator, in which case hardware graphics rendering can be poor or cause the emulator to crash.

The default is to let the emulator decide if it should use hardware or software graphics acceleration based on your computer setup. If the GPU hardware and drivers are compatible, the emulator uses the GPU; otherwise, the emulator uses the CPU to simulate GPU processing.

Graphics: Memory used for graphics buffer queues to display pixels to the screen, including GL surfaces, GL textures, and so on. (Note that this is memory shared with the CPU, not dedicated GPU memory.)

View the Java heap and memory allocations with Memory Profiler Doc

So why your Graphic use is to 0Mb is because the Memory Profiler calculating the memory shared between CPU and GPU not dedicated to GPU.

So is 0Mb because you use hardware I think instead of software to emulate the GPU.

Upvotes: 1

Related Questions