2 Replies Latest reply on Sep 7, 2012 5:01 AM by radomir.kadlec

    Memory optimization

    radomir.kadlec

      Hello,

      I use cxfbc-consumers and cxfbc-providers in apache-servicemix-4.4.1-fuse-07-11.

       

      When large messages (8 to 25 MB) are processed, the ESB consumes enorm amount of memory. I must configure Xmx to 2 GB to avoid OutOfMemory (1,5 GB are too few).

       

      Every message is only received from the consumer and posted to the provider which posted it out of the ESB to the destination service.

       

      I tried to switch off all interceptors and features of cxfbc like logging, authentization and message validation, but it doesnt really help.

      Only when I set the useJBIWrapper property to false, the memory consumption is now on about 80% of the previous, but it is still to much.

       

      Why is it so?

      Why consume the endpoints so much memory?

      Can you give me some tips to optimize the memory consumption of JBI?

      The large SOAP messages have the most part in xml elements with binary content.

      I don't need any message persistence and I don't will use ActiveMQ Broker.

       

      Thank you

      Radomir Kadlec

       

      Edited by: kadlec on Sep 6, 2012 1:52 PM

       

      Edited by: kadlec on Sep 6, 2012 1:57 PM

        • 1. Re: Memory optimization
          ffang

          Hi,

           

          If you can put the binary part of your message as a attachment, it can dramatically reduce the memory usage.

           

          That said, avoid using base64 binary encoding as much as possible should be able to improve the performance. In Fuse ESB, you should pass through the attachment just as "attachment", but not need change to base64 and pass through it. Both Camel Message and NMR message support to propagate attachment,  so inside FUSE ESB, pass through an attachment means pass through a stream handler and unless you send attachment over transport protocol, you needn't read the attachment content.

           

          Freeman

          • 2. Re: Memory optimization
            radomir.kadlec

            Hi,

            yes Freeman, I know, ussage of the message attachmet ist the best, better than to use binary attributes.

            But I can not change the webservice definition.

            Can I do some another memory optimization on FuseESB?

            Can message comprimation feature of cxf bus help me?

            Thanks

            Radomir