You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Curtiss Howard <cu...@gmail.com> on 2011/01/27 13:35:06 UTC

[Core] Releasing LifecycleProviderFactories?

Hi,

In our internal testing we've noticed that
org.apache.myfaces.config.annotation.LifecycleProviderFactory's are
_never_ released.  I don't think it's a problem for the default
implementations, but our container integration uses a special
implementation that needs to hold on to resources for the life of the
LifecycleProviderFactory.  Obviously over long runs we're running into
memory leaks.

The fix is very simple -- just call release() in
StartupServletContextListener.contextDestroyed().  The catch is that
I've noticed a couple test cases where the factories are manually
released, so I want to avoid doing that more than once.  Is that a
valid concern or do the tests just mock everything and therefore we're
not even using that listener?  If everyone is OK with the change I
will make a new bug and fix it.

Thanks,


Curtiss Howard

Re: [Core] Releasing LifecycleProviderFactories?

Posted by Jakob Korherr <ja...@gmail.com>.
Hi Curtiss,

This is definitely a bug.

As you said, the only place this method is used, is inside some test cases.

Big +1 on inserting the call to LifecycleProviderFactory.release()
after FactoryFinder.releaseFactories(); in
StartupServletContextListener.

Regards,
Jakob

2011/1/27 Curtiss Howard <cu...@gmail.com>:
> Hi,
>
> In our internal testing we've noticed that
> org.apache.myfaces.config.annotation.LifecycleProviderFactory's are
> _never_ released.  I don't think it's a problem for the default
> implementations, but our container integration uses a special
> implementation that needs to hold on to resources for the life of the
> LifecycleProviderFactory.  Obviously over long runs we're running into
> memory leaks.
>
> The fix is very simple -- just call release() in
> StartupServletContextListener.contextDestroyed().  The catch is that
> I've noticed a couple test cases where the factories are manually
> released, so I want to avoid doing that more than once.  Is that a
> valid concern or do the tests just mock everything and therefore we're
> not even using that listener?  If everyone is OK with the change I
> will make a new bug and fix it.
>
> Thanks,
>
>
> Curtiss Howard
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at