Hmm, are you putting 30K of xml into memory? or only parsing the results as
they are needed?
In other words, are there references left around that is causing the heap to
grow?
-jacobd

On Mon, Sep 14, 2009 at 1:16 PM, Jason Berk <jb...@purdueefcu.com> wrote:

> I have an xml clob and account in a DB.  I need to select the xml and
> bind it with XML Beans.  This works fine for the first 30,000 or so
> accounts, but eventually I get "ava.lang.OutOfMemoryError: Java heap
> space"
>
> This is the line that is blowing up:
> MemberStatementDocument doc = MemberStatementDocument.Factory.parse(xml,
> validationOptions);
>
> In this method to do the bind:
>
> private MemberStatement bind(String xml) throws Exception {
>                ArrayList<XmlValidationError> validationErrors = new
> ArrayList<XmlValidationError>();
>                XmlOptions validationOptions = new XmlOptions();
>                validationOptions.setErrorListener(validationErrors);
>                //validationOptions.setLoadLineNumbers();
>                //validationOptions.setLoadTrimTextBuffer();
>                //validationOptions.setUnsynchronized();
>                //validationOptions.setLoadUseXMLReader(
> SAXParserFactory.newInstance().newSAXParser().getXMLReader() );
>                MemberStatementDocument doc =
> MemberStatementDocument.Factory.parse(xml, validationOptions);
>                if (!doc.validate(validationOptions)) {
>                        logger.error("Validation errors discovered
> during binding:");
>                        Iterator<XmlValidationError> iter =
> validationErrors.iterator();
>                        while (iter.hasNext()) {
>                                logger.error(">> " + iter.next());
>                        }
>                        throw new XmlException("Validation errors
> discovered during binding:");
>                }
>                MemberStatement memberStatement =
> doc.getMemberStatement();
>                if (memberStatement.getUnknownShareList().size() > 0 ||
> memberStatement.getUnknownLoanList().size() > 0) {
>                        throw new XmlException("account contains unknown
> shares or loans");
>                }
>                return memberStatement;
>        }
>
> Is there a better way to be doing the binding?  What about the parse
> method is not playing well with the GC?
>
> Jason
> Now serving Boiler Spirit with every purchase. Switch to the new Purdue
> debit card today. Show your pride and earn Scorecard Rewards on the side.
> Just sign for your purchases and score valuable rewards points you can use
> for travel, electronics or even cash.
>
>
>
> ***This is a transmission from Purdue Employees Federal Credit
> Union (PEFCU) and is intended solely for its authorized
> recipient(s), and may contain information that is confidential
> and or legally privileged.  If you are not an addressee, or the
> employee or agent responsible for delivering it to an addressee,
> you are hereby notified that any use, dissemination,
> distribution, publication or copying of the information
> contained
> in this email is strictly prohibited. If you have received this
> transmission in error, please notify us by telephoning (765)
> 497-3328 or returning the email. You are then instructed to
> delete the information from your computer.  Thank you for your
> cooperation.***
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
> For additional commands, e-mail: user-h...@xmlbeans.apache.org
>
>

Reply via email to