4

I have a server exposing multiple web services with CXF.
I use JAXB for the XML serialization.
I have around 3000 classes in the JAXB context which requires 60 MB of memory which is too much for my environment.
Are there any lightweight alternative for providing web services / XML serialization? (other implementations)
I tried using the flag com.sun.xml.bind.v2.runtime.JAXBContextImpl.fastBoot but it didn't change the memory usage significantly.
* I already hold one context for the whole system

Avner Levy
  • 6,601
  • 9
  • 53
  • 92

2 Answers2

2

CXF supports databindings other than JAXB such as XMLBeans, Aegis, etc. Swapping the databindings is pretty straight forward. You can experiment with each data binding and see which binding takes the least amount of memory.

In my experimentation, memory was never a concern. I was more concerned with throughput. XMLBeans is way faster than JAXB when it comes to marshaling and unmarshalling requests and responses.

Chetan Kinger
  • 15,069
  • 6
  • 45
  • 82
0

There is a thread here tha talks about similar issue. It seems they have done some analysis on popular serialization.

How to serialize/deserialize complex java object quickly

Community
  • 1
  • 1
UVM
  • 9,776
  • 6
  • 41
  • 66
  • 1
    The thread suggest alternatives for java objects serialization while I need XML serialization as part of my web services stack. So I'm looking for a light weight JAXB implementation. – Avner Levy Oct 16 '12 at 04:57