0

I am using Android staggered grid to present lines of images (almost all of them have the same size). It show near 15 images per screen height. Without images (just placeholders) the scrolling works well, but with them it becomes luggy. I use pause\resume technique, but it doesn;t help much. Also I nailed it down till backbone to avoid some extra data that can leaked.

The only issue which happens quite frequently is GC call. Seems this is the root of my issue. I assume it gathered not used bitmap as viewholder is reusable here.

Do you have ideas how to decrease the frequency of GC calls for such case?

Android dev
  • 75
  • 1
  • 8
  • precisely you are loosing the images on scroll, but they do come back after some delay when you come back to some item without any activity transition. – nobalG Jul 22 '16 at 10:13
  • The lugginess is picasso's caching mechanism trying to load the images. Implement proper caching as per your need and alos remove the fade animation, it helps with the jerks – Kushan Jul 22 '16 at 10:18
  • Lagging is almost certainly not a problem in Picasso. If you post your code, maybe someone can give you specific advice. – Eric Cochran Jul 22 '16 at 22:39

1 Answers1

0

You cannot control GC. However, to reduce the amount of gc calls, you can look into proper Memory caching in picasso.

Also make sure that the images are not very big, they should roughly be the same size as your view. You might also look into using OKHTTP to implementing a disc caching solution.

Please look into the custom picasso implementation that i made to control both memory and disc cache sizes. Also made a method you can use to clear both caches if it comes to that. (see the non accepted answer for my updated answer)

Limiting Square Picasso's cache size to 60MB max

However after a lot of research, i concluded that picasso is not very efficient with memory and i am using Fresco now. It is much smoother and is way better than picasso in terms of memory footprint from what i have seen.

Community
  • 1
  • 1
Kushan
  • 5,855
  • 3
  • 31
  • 45