title: GREF increasing / decreasing in multi-threaded service (aidl) - what does it mean?
body: <p>I have an android activity and a service implemented using aidl. Works like a champ, I have a callback setup to pass some thread notifications back to the UI, and that appears to work fine, with the exception of lots of</p>
  
  <p>GREF has increased to 101, 201,301,401, 501.. etc, and GREF has decreased. I did some searching online and found that it has to do w/ Global References. </p>
  
  <pre><code>08-17 02:31:19.735: DEBUG/dalvikvm(2558): GREF has increased to 301
  ...
  08-17 02:31:25.823: DEBUG/dalvikvm(2558): GREF has increased to 401
  ...
  08-17 02:31:36.772: DEBUG/dalvikvm(2558): GREF has increased to 501
  ...
  08-17 02:31:42.694: DEBUG/dalvikvm(2558): GREF has increased to 601
  ...
  08-17 02:31:48.695: DEBUG/dalvikvm(2558): GREF has increased to 701
  ... 
  08-17 02:31:59.883: DEBUG/dalvikvm(2558): GREF has decreased to 599
  08-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 499
  08-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 399
  08-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 299
  08-17 02:31:59.912: DEBUG/dalvikvm(2558): GREF has decreased to 199
  </code></pre>
  
  <p>I did some searching and see that most of the remarks on this are rather old. My concern is that I am implementing my client/service correctly, and wanted to know how I can track down what is causing GREF to increase. Any thoughts / suggestions are welcomed. Thanks!</p>
  
  <p>Basic Program Flow</p>
  
  <pre><code>Client -&gt; Creates Callback
  Client -&gt; Starts Service
  Service -&gt; Inits &amp; Starts CountDownTimer
  Service.CountDownTimer.onFinish() -&gt; DownloadAndParse()
  DownloadAndParse() -&gt; initialize new saxRequest(), new Handler for this request.
  Service.Handler-&gt;beginBroadcast()
  Client.CallbackStub -&gt; updateUI()
  Client.CallbackStub -&gt; service.startCountDownTimer()
  </code></pre>
  
  <p>Hopefully this makes sense. I would post code here, but there is so much in so many different files. I figured I would try and put the flow up to see if there is anything glaring... The only thing I can see is maybe re-using the saxRequest() rather than creating a new instance... I will try that now actually, but I would really like to know about the impact of the GREF and the Garbage Collection..</p>