Announcement Announcement Module
Collapse
No announcement yet.
Jaxb2Marshaller holding on to objects com.sun.xml.bind.v2.model.impl.RuntimeClassInfo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jaxb2Marshaller holding on to objects com.sun.xml.bind.v2.model.impl.RuntimeClassInfo

    We're working on a heap dump to identify some production memory problems.

    The Memory Analyzer shows

    > Class Name | Shallow
    > Heap | Retained Heap | Percentage
    >
    > org.springframework.oxm.jaxb.Jaxb2Marshaller @ 0x781205ad8|
    > 80 | 5,818,424 | 5.96%



    and when we expand this there are some 8000+ instances of `com.sun.xml.bind.v2.model.impl.RuntimeClassInfoIm pl` - I've listed 3 below


    > Class Name |
    > Shallow Heap | Retained Heap | Percentage
    >
    > com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImp l @ 0x7815d9008|
    > 80 | 111,128 | 0.11%
    >
    > com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImp l @ 0x781844198|
    > 80 | 31,240 | 0.03%
    >
    > com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImp l @ 0x781515760|
    > 80 | 28,464 | 0.03%
    >


    I'd like to know if there's any Spring setting I need to change to prevent the Jaxb2Marshaller from holding on to these objects? or is this the normal behaviour?


    My Spring appContext is


    <bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="unmarshallerProperties">
    <map>
    <entry key="com.sun.xml.bind.ObjectFactory" value-ref="jaxbObjectFactory" />
    </map>
    </property>
    <property name="contextPaths">
    <list>
    <value>com.x.schema.query.v1_0</value>
    <value>com.x.schema.common.v1_0</value>
    <value>com.x.schema.content.v1_0</value>
    <value>com.x.schema.sales.v1_0</value>
    <value>com.x.schema.profile.v1_0</value>
    </list>
    </property>
    <property name="unmarshallerListener" ref="unmarshallerListener"/>
    </bean>

  • #2
    Hello

    It's rather not SpringOXM's Jaxb2Marshaller that holds these references - it's probably com.sun.xml.bind.v2.runtime.JAXBContextImpl. Check whether jaxb-impl-2.x.x.jar is in your app or in parent class loader (unless you're not in WAR environment). Do you have memory leaks? Or is it just high memory usage?

    regards
    Grzegorz Grzybek

    Comment


    • #3
      Hi Grzegorz,

      thanks for your quick reply - yes indeed the Marshaller holds com.sun.xml.bind.v2.runtime.JAXBContextImpl which I see holding these 8000+ instances.

      We are having memory leaks with very frequent GCs, so this is part of the investigations.

      I will check on what you've mentioned.

      Thanks
      jose

      Comment


      • #4
        Hi Grzegorz,

        I work in the same team as Jose.

        To answer your question, the 'jaxb-impl-2.1.9.jar' which has the JAXBContext implementation is part of the application (/WEB-INF/lib) and not in the parent class loader (in our case Tomcat).

        Regards
        Vinay
        Last edited by vinaypammi; Mar 18th, 2013, 05:03 AM.

        Comment


        • #5
          These holding references are usually a problem only if you reload your application often in Tomcat. Of course every memory leak is bad
          So do you have problems with low memory (high GC activity)? What "-Xmx" setting do you have in your Tomcat?

          Comment

          Working...
          X