cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: Unwanted bunch of Bus Provider objects in HashMap occupying large volumes of heap memory
Date Mon, 20 Jun 2016 18:41:47 GMT
Yes Sergey. You are right. Client is created for every request. And this
being the case, a new marker entry (factory hashCoded) is added everytime,
although they are not used or, referred elsewhere. It looks like a CXF

Regarding the providers, we need the providers on both hosted services as
well as clients (i.e. shared). So, your suggestion of registering the
providers only for clients does not help.

If you feel the mentioned issue is a defect, could you suggest a work-around
solution for now?

Although I have tested a custom interceptor to do the clean-up of these
entries, I need your review to see if it would impact any part of the CXF
framework. Please find the source code below.

*Java code*

/public class PurgeFactoryHashcodeInterceptor extends
AbstractPhaseInterceptor<Message> {

    public PurgeFactoryHashcodeInterceptor() {


    public void handleMessage(Message message) throws Fault {


    public void handleFault(Message message) throws Fault {


    private void cleanUpBusProperties() {

        Bus bus =
        Map<String,Object> origBusPropMap = bus.getProperties();
        for(Map.Entry<String,Object> busPropEntry :
origBusPropMap.entrySet()) {
            if(busPropEntry.getKey().startsWith("bus.providers.set.")) {

*Spring configuration*

/<bean id="purgeFtryHashcodeInterceptor"
class="" />

                     <entry key="org.apache.cxf.jaxrs.bus.providers">
                                   <ref bean="throwableExceptionMapper" />
                                   <ref bean="customFilter1" />
                     <ref bean="purgeFtryHashcodeInterceptor" />

View this message in context:
Sent from the cxf-user mailing list archive at

View raw message