Note that there are some explanatory texts on larger screens.

plurals
  1. POout of memory error in android app
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2928002/outofmemoryerror-bitmap-size-exceeds-vm-budget-android">OutOfMemoryError: bitmap size exceeds VM budget :- Android</a> </p> </blockquote> <p>in my app i have an custom list view which displays an image and some text views for each list.</p> <p>I have the images in .png format in my drawable. Every time i am listing out the image after converting it into a drawable. If the user opens the list view activity and goes back to the previous activity and once again opens the list view continuously i got an out of memory error. </p> <p>To avoid this i have set the bitmap = null and i have even recycled it. But still the same error exists.</p> <pre><code>if(icon_bmp != null) { icon_bmp.recycle(); icon_bmp = null; System.gc(); } </code></pre> <p>but still i am getting the same out of memory error. Following is my error log</p> <pre><code> Uncaught handler: thread main exiting due to uncaught exception 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): java.lang.OutOfMemoryError: bitmap size exceeds VM budget 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.Bitmap.nativeCreate(Native Method) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.Bitmap.createBitmap(Bitmap.java:468) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.Bitmap.createBitmap(Bitmap.java:435) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:346) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:372) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at com.pack.LocalDish.CustomAdapter.DishListViewAdapter.populateListData(DishListViewAdapter.java:129) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at com.pack.LocalDish.CustomAdapter.DishListViewAdapter.getView(DishListViewAdapter.java:82) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.widget.AbsListView.obtainView(AbsListView.java:1256) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.widget.ListView.makeAndAddView(ListView.java:1668) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.widget.ListView.fillDown(ListView.java:637) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.widget.ListView.fillGap(ListView.java:608) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:2531) 08-12 19:23:16.168: ERROR/AndroidRuntime(14107): at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:2353) </code></pre> <p>how to avoid this error, please help me friends</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload