Hello,

We run tests with junit and Spring. Unfortunately, we have some nasty big
Spring application contexts.

Our cxf tests are integration ones between our rest services and clients
both defined with Spring.

After some out of memory exceptions, we have analysed the heap dumps. The
first issue was with the BusFactory. So as describe in cxf documentation we
set the default bus to null (BusFactory.setDefault(null)).

But that's not enough, we still have a "leak" through the SHARED_FACTORY
object in ProviderFactory. This instance retains the SpringBus and its big
spring application context.

After some debugging session, it seems that in Spring test case scenario
this static instance is not used. Everything is done using ProviderFactory.
createInstance(Bus bus) in the jax-rs stack.

Is there a way to cleanup/remove or to have a "minimal" bus retained by
this SHARED_FACTORY static instance?


Best Regards,
J. Rodriguez.

Reply via email to