For our project, we are not building the entire object graph in memory -
rather the objects are consumed an processed while JiBX unmarshalls the
XML.  To achieve this, we use the store-method and iter-method of the
collection element in our config file (names changed to protect i.p.):

 

Configuration file:

      <mapping name="BIG_XML" class="com.myproject.ObjectUpdates">

            <collection field="_objectStream" store-method="add"
iter-method="iterator">

                  <structure name="MYELEMENT"
type="com.myproject.MyElement" choice="true" ordered="false">

      ...

 

class ObjectUpdates {

    private ObjectStream _objectStream;

}

 

class ObjectStream {       

                public void add(int position, Object object) {

                                // process here but don't store in
memory

                }

                public  Iterator iterator () {

                                // construct iterator here...

                }

}

 

From: madhu rao [mailto:rollma...@gmail.com] 
Sent: Saturday, August 15, 2009 8:27 AM
To: jibx-users@lists.sourceforge.net
Subject: [jibx-users] Parsing huge xml files using jibx

 

Hi All,

We are implementing a project in which we have a requirement of parsing
a huge xml file around 26MB. We decided to go with jibx to do this. So I
am bit concerned about the memory consumption of this operation. Here i
am looking forward for some suggestions as to how to reduce the memory
footprint of xml parsing 

Thanks
Madhu 

----
NOTICE BY HEALTH LANGUAGE, INC.
This message, as well as any attached document, contains information from 
Health Language, Inc. that is confidential.  The information is intended only 
for the use of the addressee named above.  If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution 
or the taking of any action in reliance on the contents of this message or its 
attachments is strictly prohibited, and may be unlawful.  If you have received 
this message in error, please delete all electronic copies of this message and 
its attachments, if any, destroy any hard copies you may have created, without 
disclosing the contents, and notify the sender immediately.  Unless expressly 
stated otherwise, nothing contained in this message should be construed as a 
digital or electronic signature, nor is it intended to reflect an intention to 
make an agreement by electronic means.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to