On Aug 6, 2012, at 1:22 PM, Stuart McCulloch <
mcc...@gmail.com> wrote:
> On 6 Aug 2012, at 19:56, Brian Pontarelli wrote:
>
>> Bump. Any ideas on why this is happening and how to fix it? It seems like a pretty bad memory leak in Guice that could impact GC on high scale applications.
>
> Just took a quick look and there seem to be two places that may hold onto error objects:
>
> The constructor cache in ConstructorInjectorStore
>
> An anonymous class in TypeConverterBindingProcessor
>
> The actual number of objects depends on your application - I just instrumented a multi-injector system with hundreds of bindings in total and found 33 Errors objects retaining ~4k of heap.
>
> Note that this is not a leak per se, in that it should not increase over the time of your application and will eventually get moved into the old space, but it is an overhead that could be reduced.
>
Our application has 1 injector and hundreds of bindings. We were seeing hundreds of thousands of these objects in the VM and they consume 10% or more of the heap (20-30M). I didn't dig too deep, but we were also under massive load and at points having full GCs.