Hi all,
I'd like to ask you some clarifications about a behavior that I've recently 
found with my colleague.

To make the long story short, we're using a mapBinder within a child 
injector, something like: 

@Inject Injector parentInjector;

public IWorker  WorkerFactory(Module workerModule, Module contextModule) {
       Injector localInjector = 
parentInjector.createChildInjector(workerModule, contextModule);  //<--- 
workerModule use a mapBinder
       IWorker worker = localInjector.getInstance(IWorker.class);
       return worker;
}

The worker factory is invoked many times (thousands). By profiling the 
application, we've noticed a memory leak: after a little bit of analysis, 
we've been able to track down the problem. It looks like that when the 
child injector gets created, and in particular when the addBinding of the 
mapBinder is used, a lot of internal Guice errors are generated: those 
errors are not notified (no exception is thrown), but they remain "live" 
and the GC doesn't collect them, thus increasing the memory size.

Please note that the behavior of the application, and in particular all the 
bindings, appears to be correct: our tests are all green.

Could you please help us? 

Many thanks,
Andrea

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to