Don't assume debugger wants all exceptions.
The JDWP implementation in the VM keeps a list of the objects that the
debugger knows about, and prevents the GC from collecting them (which
isn't strictly necessary, but it's a whole lot easier than doing it
right). Because of the way it's implemented, it actually ended up
keeping track of all thrown exceptions, even if the debugger wasn't
interested in hearing about them.
With this change we now do a "late" registration of the exception
object, preventing exception-happy code from filling memory when the
debugger is attached.
4 files changed