title: How to get contents of Binder transaction buffer for troubleshooting
body: <p>Is there a way, either programmatically or through a debugging tool, to know the current transactions held in the Binder transaction buffer?</p>
  
  <p>Sometimes, usually after hours/days of run, my app crashes with an error trace like this:</p>
  
  <pre><code>08-30 09:49:57.459  1879  1904 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!
  08-30 09:49:57.469  1879  1904 W BroadcastQueue: Exception when sending broadcast to ComponentInfo{com.mycompany.myapp/com.mycompany.myapp.receiver.UpdateContentReceiver}
  08-30 09:49:57.469  1879  1904 W BroadcastQueue: android.os.TransactionTooLargeException
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at android.os.BinderProxy.transact(Native Method)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at android.app.ApplicationThreadProxy.scheduleReceiver(ApplicationThreadNative.java:771)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at com.android.server.am.BroadcastQueue.processCurBroadcastLocked(BroadcastQueue.java:231)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:778)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at com.android.server.am.BroadcastQueue$1.handleMessage(BroadcastQueue.java:140)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at android.os.Handler.dispatchMessage(Handler.java:99)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at android.os.Looper.loop(Looper.java:137)
  08-30 09:49:57.469  1879  1904 W BroadcastQueue:    at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1487)
  </code></pre>
  
  <p>The broadcast I was trying to send has no extras, so it has negligible size. As per documentation of  <a href="http://developer.android.com/reference/android/os/TransactionTooLargeException.html" rel="nofollow">TransactionTooLargeException</a>:</p>
  
  <blockquote>
    <p>The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. Consequently this exception can be thrown when there are many transactions in progress even when most of the individual transactions are of moderate size.</p>
  </blockquote>
  
  <p>My hypotesis is that the buffer is filled up by something else (my app, one of the libraries I'm using or the system) and when it's almost full, it throws <code>TransactionTooLargeException</code>. By inspecting the contents of the buffer, I could easily spot the problem.</p>