Re: OutOfMemoryError: reading a large number of objects one by one

From: Tomi N/A (hefes..mail.com)
Date: Mon May 14 2007 - 15:39:53 EDT

  • Next message: Andrus Adamchik: "Re: OutOfMemoryError: reading a large number of objects one by one"

    2007/5/14, Andrus Adamchik <andru..bjectstyle.org>:
    >
    > On May 14, 2007, at 8:57 PM, Tomi N/A wrote:
    >
    > > mca = (MyClassA)
    > > Util.getCommonContext().objectFromDataRow(SpisUtil.class, dr, false);
    >
    > This is the source of the memory leak. You may want to replace the
    > context after processing an X number of rows.

    No effect, captain.
    I replaced
        Util.getCommonContext().objectFromDataRow(SpisUtil.class, dr, false);
    with
        Util.getNewContext().objectFromDataRow(SpisUtil.class, dr, false)
    where getNewContext() does
        return Configuration.getSharedConfiguration().getDomain().createDataContext();

    I understand I wouldn't want to create a new DataContext for *every*
    DataObject, but I had hoped it would be proof of concept.

    Any other ideas, comments, hints as to why the above approach didn't work?

    Cheers,
    t.n.a.



    This archive was generated by hypermail 2.0.0 : Mon May 14 2007 - 15:40:36 EDT