2008/10/29 Bob Lee <[EMAIL PROTECTED]>

> On Tue, Oct 28, 2008 at 10:49 PM, Gili Tzabari <[EMAIL PROTECTED]>wrote:
>
>>        This issue affects more than just Guice. Any code depending on
>> Google
>> Collections would potentially suffer from this memory leak while running
>> under a web container. Look, I don't understand the reluctance. Did I
>> fail to provide a good use-case? Did I say something wrong?
>>
>
> My point is just that your proposal would require adding a shutdown()
> method to both the Google Collections and the Guice APIs (since Google
> Collections is an internal implementation detail). It would also require
> users to explicitly invoke this shutdown hook (which very well may become a
> no-op in some future version).
>
> Rather than add a shutdown hook, we'll just use my solution above which
> requires no API changes or servlet context hooks.
>

Hi Bob,

your current solution relies on reading the classfile from the current
classloader
by using getResourceAsStream(), but I don't think this is guaranteed to work
in
all situations - a safer solution would be to use ASM to generate the
bytecode
at runtime (downside: even more code and less readable)

but then again, the ASM generated class could be very simple, perhaps just
a loop that calls a Callable<Boolean> object passed in via the constructor?

Bob
>
> >

-- 
Cheers, Stuart

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to