title: How to handle :java.util.concurrent.TimeoutException: android.os.BinderProxy.finalize() timed out after 10 seconds errors?
body: <p>We're seeing a number of <code>TimeoutExceptions</code> in <code>GcWatcher.finalize, BinderProxy.finalize</code>, and <code>PlainSocketImpl.finalize</code>.  90+% of them happen on Android 4.3.  We're getting reports of this from Crittercism from users out in the field.</p>
  
  <p><img src="https://i.stack.imgur.com/1PqL5.png" alt="enter image description here"></p>
  
  <p>The error is a variation of: "<code>com.android.internal.BinderInternal$GcWatcher.finalize() timed out after 10 seconds</code>"</p>
  
  <pre><code>java.util.concurrent.TimeoutException: android.os.BinderProxy.finalize() timed out after 10 seconds
  at android.os.BinderProxy.destroy(Native Method)
  at android.os.BinderProxy.finalize(Binder.java:459)
  at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:187)
  at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
  at java.lang.Thread.run(Thread.java:841)
  </code></pre>
  
  <p>So far we haven't had any luck reproducing the problem in house or figuring out what might have caused it.</p>
  
  <p>Any ideas what can cause this?
  Any idea how to debug this and find out which part of the app causes this? 
  Anything that sheds light on the issue helps.</p>
  
  <p>More Stacktraces: </p>
  
  <pre><code>1   android.os.BinderProxy.destroy  
  2   android.os.BinderProxy.finalize Binder.java, line 482
  3   java.lang.Daemons$FinalizerDaemon.doFinalize    Daemons.java, line 187
  4   java.lang.Daemons$FinalizerDaemon.run   Daemons.java, line 170
  5   java.lang.Thread.run    Thread.java, line 841  
  </code></pre>
  
  <p>2</p>
  
  <pre><code>1   java.lang.Object.wait   
  2   java.lang.Object.wait   Object.java, line 401
  3   java.lang.ref.ReferenceQueue.remove ReferenceQueue.java, line 102
  4   java.lang.ref.ReferenceQueue.remove ReferenceQueue.java, line 73
  5   java.lang.Daemons$FinalizerDaemon.run   Daemons.java, line 170
  6   java.lang.Thread.run
  </code></pre>
  
  <p>3   </p>
  
  <pre><code>1   java.util.HashMap.newKeyIterator    HashMap.java, line 907
  2   java.util.HashMap$KeySet.iterator   HashMap.java, line 913
  3   java.util.HashSet.iterator  HashSet.java, line 161
  4   java.util.concurrent.ThreadPoolExecutor.interruptIdleWorkers    ThreadPoolExecutor.java, line 755
  5   java.util.concurrent.ThreadPoolExecutor.interruptIdleWorkers    ThreadPoolExecutor.java, line 778
  6   java.util.concurrent.ThreadPoolExecutor.shutdown    ThreadPoolExecutor.java, line 1357
  7   java.util.concurrent.ThreadPoolExecutor.finalize    ThreadPoolExecutor.java, line 1443
  8   java.lang.Daemons$FinalizerDaemon.doFinalize    Daemons.java, line 187
  9   java.lang.Daemons$FinalizerDaemon.run   Daemons.java, line 170
  10  java.lang.Thread.run
  </code></pre>
  
  <p>4</p>
  
  <pre><code>1   com.android.internal.os.BinderInternal$GcWatcher.finalize   BinderInternal.java, line 47
  2   java.lang.Daemons$FinalizerDaemon.doFinalize    Daemons.java, line 187
  3   java.lang.Daemons$FinalizerDaemon.run   Daemons.java, line 170
  4   java.lang.Thread.run
  </code></pre>