On Jan 3, 12:18 am, EboMike <[email protected]> wrote:
> I take that back... I looked a lot more into the issue, and it seems
> that the leak only occurs when a debugger is attached.

The interaction between GCs and debuggers is a little weird on a good
day.  The current implementation of Dalvik takes a very simple-minded
approach, and just keeps a list of every object the debugger has
seen.  This list is part of the GC root set.

JDWP does allow for better ways of handling this, but implementing it
requires tighter interaction with the GC and incurs additional
overhead, so wasn't part of 1.0.

Incidentally, when the debugger disconnects, you will see something
like this:

  I/dalvikvm(  506): Debugger has detached; object registry had 1
entries

That tells you how many objects ended up "caught" by the debugger.

See also "Notes on garbage collection and object registration" near
the top of dalvik/vm/Debugger.c:

  
http://android.git.kernel.org/?p=platform/dalvik.git;a=blob;f=vm/Debugger.c;h=02bb8a66bba1924bc60f1a0dfbb61ab173d2974c;hb=HEAD

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to