我的应用程序有内存泄漏,在我使用 MAT 后,我找到了两张图片。它们如下: 大小:640*902,75.2kb
但在 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>".
我正在使用三星 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"
我怎么解决这个问题?保留堆太大!!