You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by ky...@bridge9.sakura.ne.jp on 2015/10/25 08:07:23 UTC

Eliminating "OutOfMemoryError: PermGen space" caused by Finalizer thread of Guice

Hi team,

I'm working on fixing "OutOfMemoryError: PermGen space", that is caused
by class loader leak of Roller. Fixing of this will improve development
and deployment process. For example, We won't need restart Tomcat every
time we see that error, Also it enables rolling update (zero-downtime
deploy) of some modern application containers. It should be beneficial
for users too.

I've fixed some obvious causes in recent commits but some problems are
still remained. One of the problems remain is the Finalizer thread of
Google Guice. It keeps running after Roller is undeployed with strong
reference to classes that loaded by WebAppClassloader of Roller. Here's
detailed information: https://github.com/google/guice/issues/288

I think there are two solutions:

(a) Updating Google Guice to 4.0 (Guice has stopped using Finalizer
thread in that version)
(b) Adding a ServletContextListener based on
https://gist.githubusercontent.com/gissuebot/d6ab8d55d9b6c53f020c/raw/75903663890d0384313f38d46ae01ce7eb884b87/GuiceLifecycleListener.java
.

Personally I prefer (a), but it is a major update so may cause some
compatibilty issue. Also I've confirmed (b) has successfully stopped the
Finalizer thread, but not sure if we really want to add such kludgey
workaround to our codebase.

Which do you think is better? Also other opinion or feedback would be
appreciated.

Kohei

Re: Eliminating "OutOfMemoryError: PermGen space" caused by Finalizer thread of Guice

Posted by ky...@bridge9.sakura.ne.jp.
Hi Dave,

Thanks for your opinion, I would try upgrading Guice in a few weeks.

Bug Filed: https://issues.apache.org/jira/browse/ROL-2083

Kohei

On 10/26/15 6:33, Dave wrote:
> Hi Kyle,
>
> I agree with you. I think upgrading to Guice 4 is the better option, but
> upgrading Guice may force us to upgrade some of our other dependencies. Let
> me know if you have problems wth the upgrade, I've done through the Guice 3
> -> 4 upgrade before for other apps.
>
> Dave
>
>
>
> On Sun, Oct 25, 2015 at 3:07 AM <ky...@bridge9.sakura.ne.jp> wrote:
>
>> Hi team,
>>
>> I'm working on fixing "OutOfMemoryError: PermGen space", that is caused
>> by class loader leak of Roller. Fixing of this will improve development
>> and deployment process. For example, We won't need restart Tomcat every
>> time we see that error, Also it enables rolling update (zero-downtime
>> deploy) of some modern application containers. It should be beneficial
>> for users too.
>>
>> I've fixed some obvious causes in recent commits but some problems are
>> still remained. One of the problems remain is the Finalizer thread of
>> Google Guice. It keeps running after Roller is undeployed with strong
>> reference to classes that loaded by WebAppClassloader of Roller. Here's
>> detailed information: https://github.com/google/guice/issues/288
>>
>> I think there are two solutions:
>>
>> (a) Updating Google Guice to 4.0 (Guice has stopped using Finalizer
>> thread in that version)
>> (b) Adding a ServletContextListener based on
>>
>> https://gist.githubusercontent.com/gissuebot/d6ab8d55d9b6c53f020c/raw/75903663890d0384313f38d46ae01ce7eb884b87/GuiceLifecycleListener.java
>> .
>>
>> Personally I prefer (a), but it is a major update so may cause some
>> compatibilty issue. Also I've confirmed (b) has successfully stopped the
>> Finalizer thread, but not sure if we really want to add such kludgey
>> workaround to our codebase.
>>
>> Which do you think is better? Also other opinion or feedback would be
>> appreciated.
>>
>> Kohei
>>
>

Re: Eliminating "OutOfMemoryError: PermGen space" caused by Finalizer thread of Guice

Posted by Dave <sn...@gmail.com>.
Hi Kyle,

I agree with you. I think upgrading to Guice 4 is the better option, but
upgrading Guice may force us to upgrade some of our other dependencies. Let
me know if you have problems wth the upgrade, I've done through the Guice 3
-> 4 upgrade before for other apps.

Dave



On Sun, Oct 25, 2015 at 3:07 AM <ky...@bridge9.sakura.ne.jp> wrote:

> Hi team,
>
> I'm working on fixing "OutOfMemoryError: PermGen space", that is caused
> by class loader leak of Roller. Fixing of this will improve development
> and deployment process. For example, We won't need restart Tomcat every
> time we see that error, Also it enables rolling update (zero-downtime
> deploy) of some modern application containers. It should be beneficial
> for users too.
>
> I've fixed some obvious causes in recent commits but some problems are
> still remained. One of the problems remain is the Finalizer thread of
> Google Guice. It keeps running after Roller is undeployed with strong
> reference to classes that loaded by WebAppClassloader of Roller. Here's
> detailed information: https://github.com/google/guice/issues/288
>
> I think there are two solutions:
>
> (a) Updating Google Guice to 4.0 (Guice has stopped using Finalizer
> thread in that version)
> (b) Adding a ServletContextListener based on
>
> https://gist.githubusercontent.com/gissuebot/d6ab8d55d9b6c53f020c/raw/75903663890d0384313f38d46ae01ce7eb884b87/GuiceLifecycleListener.java
> .
>
> Personally I prefer (a), but it is a major update so may cause some
> compatibilty issue. Also I've confirmed (b) has successfully stopped the
> Finalizer thread, but not sure if we really want to add such kludgey
> workaround to our codebase.
>
> Which do you think is better? Also other opinion or feedback would be
> appreciated.
>
> Kohei
>