android universal image loader out of memory -


i'm loading 50 images. in activity have configuration

    displayimageoptions defaultoptions = new displayimageoptions.builder()             .cacheondisk(true).cacheinmemory(true)             .imagescaletype(imagescaletype.exactly)             .resetviewbeforeloading(true)             .displayer(new fadeinbitmapdisplayer(300))             .build();      imageloaderconfiguration config = new imageloaderconfiguration.builder(getapplicationcontext())         .defaultdisplayimageoptions(defaultoptions)         .memorycache(new weakmemorycache())         .diskcachesize(100 * 1024 * 1024)         .build();      imageloader.getinstance().init(config); 

in binderdata

imageloader imageloader = imageloader.getinstance(); imageloader.displayimage(uri, holder.iv_img); 

some images loaded, not , outofmemory error.

check tips useful info

if got outofmemoryerror in app using universal image loader then:

  1. disable caching in memory. if oom still occurs seems app has memory leak. use memoryanalyzer detect it. otherwise try following steps (all of them or several):
  2. reduce thread pool size in configuration (.threadpoolsize(...)). 1 - 5 recommended.
  3. use .bitmapconfig(bitmap.config.rgb_565) in display options. bitmaps in rgb_565 consume 2 times less memory in argb_8888.
  4. use .imagescaletype(imagescaletype.exactly) (your use tips)
  5. use .diskcacheextraoptions(480, 320, null) in configuration

hope helps!!


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -