admin管理员组

文章数量:1313175

I am doing memory analytis for my application, using dumpsys and below command adb shell dumpsys meminfo I get the dalvik heap and native heap memory .....but I also see GPU memory adb shell dumpsys gfxinfo I am failing to understand when is GPU memory used and when is native memory used for bitmaps.Also the texture view, surface view is used where?

More clarity needed in analysis.

I am doing memory analytis for my application, using dumpsys and below command adb shell dumpsys meminfo I get the dalvik heap and native heap memory .....but I also see GPU memory adb shell dumpsys gfxinfo I am failing to understand when is GPU memory used and when is native memory used for bitmaps.Also the texture view, surface view is used where?

More clarity needed in analysis.

Share Improve this question asked Jan 31 at 4:04 pritesh tiwarypritesh tiwary 1 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Bot Commented Jan 31 at 6:54
Add a comment  | 

1 Answer 1

Reset to default -1

In Android memory analysis, adb shell dumpsys meminfo shows Dalvik Heap (Java/Kotlin objects, software-rendered Bitmaps) and Native Heap (C/C++ allocations, hardware-accelerated Bitmaps). When hardware acceleration is enabled (setHardwareAccelerated(true)), Bitmaps are stored in Native Heap instead of Dalvik:

bitmap.setConfig(Bitmap.Config.HARDWARE)

GPU memory, analyzed via adb shell dumpsys gfxinfo, is used when rendering with OpenGL/SurfaceFlinger, storing textures and shaders. TextureView relies on the GPU for smooth animations, whereas SurfaceView provides a separate rendering surface, making it efficient for media playback. Identifying where Bitmaps are stored helps optimize memory usage and prevent OOM(Out of Memory) errors.

本文标签: Android Native Memory vs GPU MemoryStack Overflow