cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [IMP] Performance Killer and Memory leak
Date Sun, 02 Nov 2003 18:44:29 GMT
Hi all,

after the Go Life of the new version of the BASF eCommerce Application,
running on top of Cocoon 2.1.2 we had a special performance effect.
After a restart of the server the startpage of the portal has a response
time of 70ms. After one day of work and a lot of page hits the response
time grows to 700ms and after one week to over 4seconds :-( The time was
nearly independent from the load of the server.

After a long time of debugging I found out the reason, it's inside
org.apache.avalon.excalibur.component.DefaultComponentFactory. The Factory
creates a special ComponentManagerProxy/ServiceManagerProxy for every
composable/servicable Component and pass this Instance to the
compose/service method.

The description why this Proxy is created:
 * Proxy <code>ComponentManager</code> class to maintain references to
 * components looked up within a <code>Composable</code> instance created
 * by this factory.
 * This class acts a safety net to ensure that all components looked
 * up within a <code>Composable</code> instance created by this factory are
 * released when the instance itself is released.

What happen inside?

public Component lookup( String role ) throws ComponentException
    Component component = m_realManager.lookup( role );
    addUnreleased( component );
    return component;

public void release( Component component )
    removeUnreleased( component );
    m_realManager.release( component );

The lookup/release add/remove the component to/from an ArrayList. If you
have a lot of Components which lookup other Components inside the compose
method the List can be really big. If you have a lot of SubSitemaps which
use many InputModules it grows and grows ..... and the performance goes
down and down ...
Ok, but this is not the Killer. The Killer are Composable
RequestLifecycleComponents, because they are usually lookuped from other
Components using the ComponentManagerProxy but are released by the
CocoonComponentManager which doesn't use the ComponentManagerProxy. What
happen is, that they are not removed from the List, so the List explode.

I think this Proxy Class is completely unnecessary, because Components
which are lookup inside compose should be released inside dispose.

So my proposal is remove ComponentManagerProxy/ServiceManagerProxy from

What do you think?


View raw message