I am developing an android service using aidl.
I realized that the objects returned in Service.onBind() are never
freed (e.g. finalize() is never called) even after onUnbind() and
onDestroy() and playing with the eclipse GC button.
I checked that the memory leak did not come from my Binder
implementation (by using an intermediate stub class, the finalize() is
actually called on the "proxied" instance).
Even if I return something like
return new Binder()
    {
      @Override
      protected void finalize() throws Throwable
      {
         Log.v("tmp", "finalizing binder");
         super.finalize();
      }
    };
in onBind(), finalize is never called.
As a workaround I use a pool for binder objects wrapping real
implementations, and I reuse it but I wonder if it's safe.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to