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

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue May 15 2007 - 08:30:07 EDT

  • Next message: Marc Gabriel-Willem: "Oracle stored procedure - registering out ref cursor"

    On May 15, 2007, at 12:47 AM, Tomi N/A wrote:

    > Reduced the max number of objects to 1000. The result? A NPE at:
    > for (MyClassC mcc :
    > (List<MyClassC>)mca.getToMyClassC().getToParentClass
    > ().getMyClassCArray())
    > {

    Ok, so the cache size will have to be big enough to hold all resolved
    objects within the lifetime of a context. So let's try another
    strategy. Return the max objects back to 10000 and uncheck "use
    shared cache" for the DataDomain.

    If this doesn't work, I suggest to run the app in profiler to see
    exactly how objects are allocated and collected.

    > The database referential integrity ensures there can be no nulls if
    > (mcc != null), which it is.
    > As far as -Xmx is concerned, it's at it's default value (64M), which
    > should be several times more than necessary for the job.

    Agreed - the default 64m should be enough if there's no leaks.

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue May 15 2007 - 08:30:42 EDT