我的應用程序有內存泄漏,而我使用的MAT後,我發現了兩個pictures.They是以下幾點: 尺寸:640 * 902,75.2kb爲什麼內存轉儲中的png pictrue是原始圖像的兩倍?
但在MAT:
Class Name | Shallow Heap | Retained Heap | Percentage
--------------------------------------------------------------------------------
android.graphics.Bitmap @ 0x41acff20| 40 | 9,625,656 | 18.76%
--------------------------------------------------------------------------------
Type |Name |Value
------------------------------
int |mHeight |1880
int |mWidth |1280
------------------------------
Problem Suspect 2
One instance of "android.graphics.Bitmap" loaded by "<system class loader>" occupies 9,625,656 (18.76%) bytes. The memory is accumulated in one instance of "byte[]" loaded by "<system class loader>".
Problem Suspect 3
One instance of "android.graphics.Bitmap" loaded by "<system class loader>" occupies 9,236,536 (18.00%) bytes. The memory is accumulated in one instance of "byte[]" loaded by "<system class loader>".
我正在使用Samsung Galaxy SIII,4.04 sdk。
以XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/main_menu_bg"
我怎樣才能解決這個問題?保留堆太大!
你好,我看到一些信息在MAT像android.graphics.Bitmap @ 0x41acff20。我在哪裏可以看到它是哪個圖像?如何查看它? –
@ Maid786你可以看到這個問題。[_查看內存dump_中的bitmaps](http://stackoverflow.com/questions/12709603/mat-eclipse-memory-analyzer-how-to-view-bitmaps-from-memory-dump/12709604#12709604) – JasonW