title: Universal-Image-Loader: OutOfMemory Error
body: <p>I am using universal-image-loader-1.6.2.jar (Latest one).
  I am trying to Download and cache that images using this library. I have 47 images to be downloaded from server, total of 5.22 Mb.My Maximum images are of dimension are 720X480 and size around 143kb. It goes well till 40-41 images after that it gives error </p>
  
  <pre><code>11-02 16:30:12.150: E/ImageLoader(31033): null
  11-02 16:30:12.150: E/ImageLoader(31033): java.lang.OutOfMemoryError
  11-02 16:30:12.150: E/ImageLoader(31033):   at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
  11-02 16:30:12.150: E/ImageLoader(31033):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:493)
  11-02 16:30:12.150: E/ImageLoader(31033):   at com.nostra13.universalimageloader.core.ImageDecoder.decode(ImageDecoder.java:83)
  11-02 16:30:12.150: E/ImageLoader(31033):   at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.saveImageOnDisc(LoadAndDisplayImageTask.java:218)
  11-02 16:30:12.150: E/ImageLoader(31033):   at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:138)
  11-02 16:30:12.150: E/ImageLoader(31033):   at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:72)
  11-02 16:30:12.150: E/ImageLoader(31033):   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
  11-02 16:30:12.150: E/ImageLoader(31033):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  11-02 16:30:12.150: E/ImageLoader(31033):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  11-02 16:30:12.150: E/ImageLoader(31033):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  11-02 16:30:12.150: E/ImageLoader(31033):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  11-02 16:30:12.150: E/ImageLoader(31033):   at java.lang.Thread.run(Thread.java:856)
  11-02 16:30:47.170: E/Adreno200-ES20(31033): &lt;qgl2DrvAPI_glUseProgram:1318&gt;: **** 31033: glUseProgram(3)
  11-02 16:30:47.170: E/Adreno200-ES20(31033): &lt;qgl2DrvAPI_glUseProgram:1318&gt;: **** 31033: glUseProgram(6)
  </code></pre>
  
  <p>I have seen and implemented suggestion about OOM on git-hub. I followed them still i am getting error.
  Here is my code </p>
  
  <pre><code>if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))
          cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),"neongall");
      else
          cacheDir=context.getCacheDir();
      if(!cacheDir.exists())
          cacheDir.mkdirs();
  
      ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
      .threadPoolSize(3)
      .threadPriority(Thread.NORM_PRIORITY - 1)
      .memoryCache(new WeakMemoryCache())
      .denyCacheImageMultipleSizesInMemory()
      .offOutOfMemoryHandling()
      .discCacheExtraOptions(720, 480, CompressFormat.JPEG, 75)
      .discCache(new UnlimitedDiscCache(cacheDir)) // You can pass your own disc cache implementation
      .discCacheFileNameGenerator(new HashCodeFileNameGenerator())
      .imageDownloader(new URLConnectionImageDownloader(120 * 1000, 120 * 1000)) // connectTimeout (5 s), readTimeout (20 s)
      .defaultDisplayImageOptions(DisplayImageOptions.createSimple())
      .enableLogging()
      .build();
      //Initialize ImageLoader with created configuration. Do it once on Application start.
      imageLoader.init(config);
  
  
      options = new DisplayImageOptions.Builder()
      .cacheOnDisc()
      .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
      .displayer(new RoundedBitmapDisplayer(10))
      .build();
  </code></pre>
  
  <p>Thanks in advance.</p>