Comment #41 on issue 288 by [email protected]: FinalizableReferenceQueue still leaks
http://code.google.com/p/google-guice/issues/detail?id=288
The problem is that when you create the child Finalizer thread inside a secure app container there are internal JVM references back to the parent thread (access context, etc.) that means it cannot be GC'd, and it is these refs that keep the thread around. These internal refs can be nulled out using reflection, but then you're making deep assumptions about JVM internals which may change.
Using an executor means you can control how this background work is scheduled - ie. you can choose the thread and forcibly stop that thread if the work fails to completely properly. For libraries like guava (which has the same issue) you could multiplex work onto one thread - rather than have multiple threads managing Finalizers.
Using executors is also better than a single big red shutdown button because it works better with containers that might want to share the Guice library between multiple applications. Or to put it another way: guice wants to do some background work, and the executor API is how it can communicate that wish with the container.
-- You received this message because you are subscribed to the Google Groups "google-guice-dev" 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/google-guice-dev?hl=en.
