我在问一个不同的问题时遇到了这个问题,为什么Android模拟器显示的性能配置文件与可比较的设备配置文件如此不同?
具体来说,设备会调用一个巨大的图形部分,而该部分在模拟器上不可见...这是有原因的吗?
答案 0 :(得分:1)
这取决于您如何使用Emulator
配置RAM
和HAXM
。
如果System.gc()
Emulator
大于RAM
,则可以减少Device
的应用性能。
但这不是唯一的事情,您可以配置HAXM
加速HAXM acceleration Doc。
说明
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.
说明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
所以您的Graphic use
之所以成为0Mb
的原因是因为Memory Profiler
计算CPU
和GPU
之间共享的内存不是专用于GPU
0Mb也是如此,因为我认为您使用的是hardware
而不是software to emulate the GPU
。