Thanks! (Romain just posted the same thing on the now-closed 6418 change).
This problem seems to be particularly prevalent with exceptions - I wrote a test app that throws an exception every 10ms and it OOMs very quickly (and you can see the memory pile up), but also with files (which was what 6418 was about in the first place -- I called close() on a BufferedInputStream, and that kind of closed a big leak when using the debugger). I'll write this up as an issue if that's OK since this is a major problem when debugging an app -- I can't really debug my app without it OOMing very quickly. Without a debugger attached, the memory usage is stable. On Jan 5, 1:51 pm, fadden <fad...@android.com> wrote: > On Jan 3, 12:18 am, EboMike <ebom...@gmail.com> 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/Debu... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---