<p dir="auto"><strong>Glide Version</strong>:<br>
3.7</p>

<p dir="auto"><strong>Integration libraries</strong>:<br>
okhttp3</p>

<p dir="auto"><strong>Device/Android Version</strong>:<br>
Galaxy Nexus 4.1.1 API 16 720X1250 on Genymotion emulator</p>

<p dir="auto"><strong>Issue details / Repro steps / Use case background</strong>:</p>

<p dir="auto"><strong>Glide load line / <code class="notranslate">GlideModule</code> (if any) / list Adapter code (if any)</strong>:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Glide.with..."><pre class="notranslate"><span class="pl-smi">Glide</span>.<span class="pl-smi">with</span>...</pre></div>
<p dir="auto">I download the image from network by glide. The ui has a viewpager. The viewPager contains some fragments.  When I exit from activity some times, I view the memory from device motiors ( I click the GC some  times), the activity exists.<br>
If I remove the glide, test as above, the activity doesn't exist.</p>
<p dir="auto">In adapter, I call Glide.with(Fragment). When I debug, it call RequestManager.onDestroy().</p>
<p dir="auto">I find that when call removeCallback() in EngineJob, the hasResource is true. so it can't be removed.</p>

<p dir="auto"><strong>Layout XML</strong>:</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;FrameLayout xmlns:android=&quot;..."><pre class="notranslate">&lt;<span class="pl-ent">FrameLayout</span> <span class="pl-e">xmlns</span><span class="pl-e">:</span><span class="pl-e">android</span>=<span class="pl-s"><span class="pl-pds">"</span>...</span></pre></div>

<p dir="auto"><strong>Stack trace / LogCat</strong>:</p>
<div class="highlight highlight-source-ruby notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="* com.energysh.drawshow.activity.MainActivity has leaked:
* GC ROOT thread com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.&lt;Java Local&gt; (named 'fifo-pool-thread-0')
* references com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$LoadTask.sync
* references java.util.concurrent.FutureTask$Sync.callable
* references java.util.concurrent.Executors$RunnableAdapter.task
* references com.bumptech.glide.load.engine.EngineRunnable.manager
* references com.bumptech.glide.load.engine.EngineJob.cbs
* references java.util.ArrayList.array
* references array java.lang.Object[].[0]
* references com.bumptech.glide.request.GenericRequest.target
* references com.bumptech.glide.request.target.GlideDrawableImageViewTarget.view
* references android.support.v7.widget.AppCompatImageView.mParent
* references android.widget.RelativeLayout.mContext
* leaks com.energysh.drawshow.activity.MainActivity instance

* Reference Key: 8d2d5a37-792b-4483-b624-0e9591d16137
* Device: Genymotion generic Google Galaxy Nexus - 4.1.1 - API 16 - 720x1280 vbox86p
* Android Version: 4.1.1 API: 16
* Durations: watch=5032ms, gc=118ms, heap dump=185ms, analysis=10329ms"><pre class="notranslate">* <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">energysh</span><span class="pl-kos">.</span><span class="pl-en">drawshow</span><span class="pl-kos">.</span><span class="pl-en">activity</span><span class="pl-kos">.</span><span class="pl-v">MainActivity</span> <span class="pl-en">has</span> <span class="pl-pds">leaked</span>:
* <span class="pl-c1">GC</span> <span class="pl-c1">ROOT</span> <span class="pl-en">thread</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">.</span><span class="pl-en">engine</span><span class="pl-kos">.</span><span class="pl-en">executor</span><span class="pl-kos">.</span><span class="pl-en">FifoPriorityThreadPoolExecutor</span>$DefaultThreadFactory$1<span class="pl-kos">.</span>&lt;<span class="pl-v">Java</span> <span class="pl-v">Local</span>&gt; <span class="pl-kos">(</span><span class="pl-en">named</span> <span class="pl-s">'fifo-pool-thread-0'</span><span class="pl-kos">)</span>
* <span class="pl-en">references</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">.</span><span class="pl-en">engine</span><span class="pl-kos">.</span><span class="pl-en">executor</span><span class="pl-kos">.</span><span class="pl-v">FifoPriorityThreadPoolExecutor</span>$LoadTask<span class="pl-kos">.</span><span class="pl-en">sync</span>
* <span class="pl-en">references</span> <span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">util</span><span class="pl-kos">.</span><span class="pl-en">concurrent</span><span class="pl-kos">.</span><span class="pl-v">FutureTask</span>$Sync<span class="pl-kos">.</span><span class="pl-en">callable</span>
* <span class="pl-en">references</span> <span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">util</span><span class="pl-kos">.</span><span class="pl-en">concurrent</span><span class="pl-kos">.</span><span class="pl-v">Executors</span>$RunnableAdapter<span class="pl-kos">.</span><span class="pl-en">task</span>
* <span class="pl-en">references</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">.</span><span class="pl-en">engine</span><span class="pl-kos">.</span><span class="pl-en">EngineRunnable</span><span class="pl-kos">.</span><span class="pl-en">manager</span>
* <span class="pl-en">references</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">.</span><span class="pl-en">engine</span><span class="pl-kos">.</span><span class="pl-en">EngineJob</span><span class="pl-kos">.</span><span class="pl-en">cbs</span>
* <span class="pl-en">references</span> <span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">util</span><span class="pl-kos">.</span><span class="pl-en">ArrayList</span><span class="pl-kos">.</span><span class="pl-en">array</span>
* <span class="pl-en">references</span> <span class="pl-en">array</span> <span class="pl-en">java</span><span class="pl-kos">.</span><span class="pl-en">lang</span><span class="pl-kos">.</span><span class="pl-en">Object</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en"></span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span>
* <span class="pl-en">references</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">request</span><span class="pl-kos">.</span><span class="pl-en">GenericRequest</span><span class="pl-kos">.</span><span class="pl-en">target</span>
* <span class="pl-en">references</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">bumptech</span><span class="pl-kos">.</span><span class="pl-en">glide</span><span class="pl-kos">.</span><span class="pl-en">request</span><span class="pl-kos">.</span><span class="pl-en">target</span><span class="pl-kos">.</span><span class="pl-en">GlideDrawableImageViewTarget</span><span class="pl-kos">.</span><span class="pl-en">view</span>
* <span class="pl-en">references</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">support</span><span class="pl-kos">.</span><span class="pl-en">v7</span><span class="pl-kos">.</span><span class="pl-en">widget</span><span class="pl-kos">.</span><span class="pl-en">AppCompatImageView</span><span class="pl-kos">.</span><span class="pl-en">mParent</span>
* <span class="pl-en">references</span> <span class="pl-en">android</span><span class="pl-kos">.</span><span class="pl-en">widget</span><span class="pl-kos">.</span><span class="pl-en">RelativeLayout</span><span class="pl-kos">.</span><span class="pl-en">mContext</span>
* <span class="pl-en">leaks</span> <span class="pl-en">com</span><span class="pl-kos">.</span><span class="pl-en">energysh</span><span class="pl-kos">.</span><span class="pl-en">drawshow</span><span class="pl-kos">.</span><span class="pl-en">activity</span><span class="pl-kos">.</span><span class="pl-v">MainActivity</span> <span class="pl-en">instance</span>

* <span class="pl-v">Reference</span> <span class="pl-pds">Key</span>: <span class="pl-c1">8</span><span class="pl-en">d2d5a37</span>-<span class="pl-c1">792</span><span class="pl-en">b</span>-<span class="pl-c1">4483</span>-<span class="pl-en">b624</span>-<span class="pl-c1">0e9591</span><span class="pl-en">d16137</span>
* <span class="pl-pds">Device</span>: <span class="pl-v">Genymotion</span> <span class="pl-en">generic</span> <span class="pl-v">Google</span> <span class="pl-v">Galaxy</span> <span class="pl-en">Nexus</span> - <span class="pl-c1">4.1</span><span class="pl-kos">.</span><span class="pl-c1">1</span> - <span class="pl-c1">API</span> <span class="pl-c1">16</span> - <span class="pl-c1">720</span><span class="pl-en">x1280</span> <span class="pl-en">vbox86p</span>
* <span class="pl-v">Android</span> <span class="pl-pds">Version</span>: <span class="pl-c1">4.1</span><span class="pl-kos">.</span><span class="pl-c1">1</span> <span class="pl-pds">API</span>: <span class="pl-c1">16</span>
* <span class="pl-pds">Durations</span>: <span class="pl-en">watch</span><span class="pl-c1">=</span><span class="pl-c1">5032</span><span class="pl-en">ms</span><span class="pl-kos">,</span> <span class="pl-s1">gc</span><span class="pl-c1">=</span><span class="pl-c1">118</span><span class="pl-en">ms</span><span class="pl-kos">,</span> <span class="pl-en">heap</span> <span class="pl-s1">dump</span><span class="pl-c1">=</span><span class="pl-c1">185</span><span class="pl-en">ms</span><span class="pl-kos">,</span> <span class="pl-s1">analysis</span><span class="pl-c1">=</span><span class="pl-c1">10329</span><span class="pl-en">ms</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In com.example:2.0:45.
* com.example.ArtistActivity has leaked:
* GC ROOT thread com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.&lt;Java Local&gt; (named 'fifo-pool-thread-0')
* references com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$LoadTask.sync
* references java.util.concurrent.FutureTask$Sync.callable
* references java.util.concurrent.Executors$RunnableAdapter.task
* references com.bumptech.glide.load.engine.EngineRunnable.manager
* references com.bumptech.glide.load.engine.EngineJob.cbs
* references java.util.ArrayList.array
* references array java.lang.Object[].[0]
* references com.bumptech.glide.request.GenericRequest.target
* references com.bumptech.glide.request.target.GlideDrawableImageViewTarget.view
* references android.widget.ImageView.mContext
* references android.support.v7.internal.view.ContextThemeWrapper.mBase
* leaks com.example.ArtistActivity instance"><pre class="notranslate"><code class="notranslate">In com.example:2.0:45.
* com.example.ArtistActivity has leaked:
* GC ROOT thread com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.&lt;Java Local&gt; (named 'fifo-pool-thread-0')
* references com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$LoadTask.sync
* references java.util.concurrent.FutureTask$Sync.callable
* references java.util.concurrent.Executors$RunnableAdapter.task
* references com.bumptech.glide.load.engine.EngineRunnable.manager
* references com.bumptech.glide.load.engine.EngineJob.cbs
* references java.util.ArrayList.array
* references array java.lang.Object[].[0]
* references com.bumptech.glide.request.GenericRequest.target
* references com.bumptech.glide.request.target.GlideDrawableImageViewTarget.view
* references android.widget.ImageView.mContext
* references android.support.v7.internal.view.ContextThemeWrapper.mBase
* leaks com.example.ArtistActivity instance
</code></pre></div>
<p dir="auto">Leak Canary just found that memory leak in my app and it looks like it's related to Glide.<br>
This call is not doing anything fancy:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Glide.with(heroImage.getContext())
                .load(&quot;http://....&quot;)
                .into(heroImage);"><pre class="notranslate"><span class="pl-smi">Glide</span>.<span class="pl-en">with</span>(<span class="pl-s1">heroImage</span>.<span class="pl-en">getContext</span>())
                .<span class="pl-en">load</span>(<span class="pl-s">"http://...."</span>)
                .<span class="pl-en">into</span>(<span class="pl-s1">heroImage</span>);</pre></div>
<p dir="auto">I only reproduced the issue on API 16.</p>
<p dir="auto">Any ideas?</p>