On 20.09.2012 16:44, Daniel Kulp wrote:
This is definitely one area of JAXB/JAX-WS that I am not exactly "happy" with.
I can understand why they decided to map it to java.awt.Image, but I'm not sure why they
then didn't provide a customization option to map it to a DataHandler. For many (most?)
use cases, I'm really not sure if the user really wants an Image object. Most likely, an
InputStream or DataHandle is likely more appropriate.
Yes, I fully agree.
I normally don't recommend modifying generated code, but if you have a little
time, you could try modifying the generated code to use a DataSource or
DataHandler instead. I *THINK* CXF will work fine with it (maybe requires the
latest SNAPSHOT as I did add some additional options around this not to long
ago). That should completely remove it from memory. If that works, we could
likely write an XJC plugin that would remap the Image properties to DataSource
or DataHandler.
The good news:
a) Replacing Image with DataHandler works flawlessly with CXF 2.6.1.
b) Memory consumption is lower than before.
The bad news:
c) There's still a spike of about 700MB in heap usage (no leak though).
d) Since we run wsdl2java in each an every Maven build a) isn't an
option anyway.
Cheers,
Marcel