OutOfMemoryError: bitmap size exceeds VM budget :- Android [duplicate] OutOfMemoryError: bitmap size exceeds VM budget :- Android [duplicate] android android

OutOfMemoryError: bitmap size exceeds VM budget :- Android [duplicate]


Use decodeStream(is, outPadding, opts) with

BitmapFactory.Options opts=new BitmapFactory.Options();opts.inDither=false;                     //Disable Dithering modeopts.inPurgeable=true;                   //Tell to gc that whether it needs free memory, the Bitmap can be clearedopts.inInputShareable=true;              //Which kind of reference will be used to recover the Bitmap data after being clear, when it will be used in the futureopts.inTempStorage=new byte[32 * 1024]; 


You could check the image size and then downsample it by appropriate factor.

See this question: Handling large Bitmaps


This issue seems to have been reported several times, here and here for instance...sorry Shalini but if it's the same issue, it seems that there is no solution at all...

The only advice of Romain Guy is to use less memory...

So, good luck to think your stuff differently...