title: Android memory leak with Glide
body: <p>I have an activity which loads pictures in ImageViews with glide. Here is a sample of my glide code:</p>
  
  <pre><code>    Glide.with(ImageVOne.getContext())
              .load(geoInfo.getPhotoUrl1())
              .skipMemoryCache(true)
              .priority(Priority.NORMAL)
              .into(ImageVOne);
  </code></pre>
  
  <p>I load from 1 to 35 pictures, each picture should be between 150ko &amp; 250ko. I cannot reduce that.</p>
  
  <p>This activity can be accessed several times in a session from the main activity, and each time it loads different pictures. For example the first time it will be pictures of Washington, then pictures of London etc.</p>
  
  <p>My issue is that the use of memory increases a lot every time the activity that loads the pictures is started:
  <a href="https://i.stack.imgur.com/7Y2Su.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7Y2Su.png" alt="enter image description here"></a></p>
  
  <p>I can start the activity from 3 to 5 times, then the app crashes. The error message is</p>
  
  <pre><code>java.lang.OutOfMemoryError: Failed to allocate a 1411340 byte allocation with 1126320 free bytes and 1099KB until OOM
  </code></pre>
  
  <p>I read <a href="https://stackoverflow.com/questions/32244851/androidjava-lang-outofmemoryerror-failed-to-allocate-a-23970828-byte-allocatio">posts about memory leaks</a> but I thought Glide would avoid this issue. My activity with the pictures is finished before another one is started, but the memory allocated to my app do not seem to drop.
  I also added <code>android:noHistory="true"</code> to my picture activity in the Manifest but it doesn't change anything.</p>
  
  <p>I added <code>android:largeHeap="true"</code> in my Manifest but it just postpone my issue (I can start the pictures activity about 10 to 15 times) and I get a lot of pictures not loaded in my imageviews before the app crashes, so its not a good solution for me.</p>
  
  <p>I also tried to add .skipMemoryCache (true) when I use glide but I don't notice any change.</p>
  
  <p>I guess my "memory use" should decrease every time I go from the pictures activity to the main activity, then increase when I start my pictures activity again with new pictures. But from what I see on the blue graph it almost only increases. Do you see what I should do?</p>