Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
关于这个话题Android: OutofMemoryError....
Android: OutofMemoryError....
您如何查看 ddms (Eclipse) 上的堆大小?我只能跟踪分配,它什么也不显示
这显示了设备的最大堆内存
Runtime rt = Runtime.getRuntime(); long maxMemory = rt.maxMemory();
这是您的应用程序所需的堆
您可以从代码本机堆分配尝试:Debug.getNativeHeapAllocatedSize()
Debug.getNativeHeapAllocatedSize()