camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <hzbar...@gmail.com>
Subject Re: Classloading leak in camel-jaxb component
Date Sat, 07 Feb 2009 01:06:37 GMT
Christopher,

Thanks for catching this and pointing it out.  We'll be looking into  
it and hopefully it will make the upcoming 1.6 release.  I assume you  
are using camel-1.5.  Would it be possible to attach a quick test and  
save us a bit of time?

Hadrian



On Feb 6, 2009, at 3:09 PM, Christopher Hammack wrote:

>
> We recently discovered an issue in the camel-jaxb component which  
> has caused
> a serious issue in our environment: after several days of uptime, we  
> have
> millions of classes loaded in the permgen space.  We were passing  
> around an
> object between bean components which was annotated with  
> @XmlRootElement, and
> even though the types matched between the output of one bean  
> component and
> the input of the next bean component, the object was being  
> transformed using
> jaxb (possibly a bug there as well).
>
> Anyhow, each time this happens, this piece of code from JaxbConverter
> executes:
> protected static JAXBContext createJaxbContext(Object value) throws
> JAXBException {
>
>        if (value == null) {
>
>            throw new IllegalArgumentException("Cannot convert from  
> null
> value to JAXBSource");
>
>        }
>
>        JAXBContext context =  
> JAXBContext.newInstance(value.getClass());
>
>        return context;
>
>    }
>
> However, each time when a JAXBContext is created, the JAXB package  
> generates
> several on the fly classes which are not reused between  
> JAXBContexts.  This
> is documented here: https://jaxb.dev.java.net/issues/show_bug.cgi?id=581
>
> This results, in our case, in millions of classes named
> XXX_JaxbXducedAccessor_avail and XXX$JaxbAccessorF_YYY being loaded  
> into
> permgen and never collected.  After some period of time, permgen  
> space will
> fill and the jvm will crash.
>
> Creating a JAXBContext in this way is not safe.  Also, it's not  
> clear why
> passing an object between two bean components would invoke a JAXB
> serialization in the first place.
>
> Thanks.
>
> -- 
> View this message in context: http://www.nabble.com/Classloading-leak-in-camel-jaxb-component-tp21879801s22882p21879801.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Mime
View raw message