Thandi Ngamu Thandi Ngamu - 1 year ago 99
Android Question

Picasso Android memory issues

I am using Picasso to load 5 images, first thing first, I am resizing my image to match my screen width, which am also using as my height to have a square imageview, then am calling centercrop to make it look realistic and also removing the Alpha channel but even after all this my memory hikes to 85mb, the images are being downloaded from a server, below is the code am using

.resize((int) Utils.convertDpToPixel((int) Utils.getScreenWidth(context)), (int) Utils.convertDpToPixel((int) Utils.getScreenWidth(context)))
.into(viewHolder.img_image, new Callback() {
public void onSuccess() {


public void onError() {

Here is an image showing the memory usageenter image description here

One other thing I have noticed is Picasso does not clear memory after usage, sometimes it shows am using 20mb but when I call the
from Android Studio memory falls to about 8mb is there anything I need to do about this?

Answer Source

You are calling GC and memory falls into minimum value? This says that there is no strong references to used bitmaps. Everything is OK.

Large memory usage happens due to decoding large images into bitmaps. Bitmap format is pretty heavy. There is nothing do about this. I recommend you to lower resolution of the decoded bitmaps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download