Re: Cayenne performance degrades over time

From: Jonathan Carlson (Jonathan.Carlso..atun.com)
Date: Wed Jun 22 2005 - 15:48:27 EDT

  • Next message: Andrus Adamchik: "Re: Error during Configuration initialization -- running on Websphere"

    Andrus, when you say "multi user app", are you assuming a DataContext
    created like this?:

    // assume this exists
    HttpSession session;
    DataContext context =
    BasicServletConfiguration.getDefaultContext(session);

    or this?:

    DataContext context = DataContext.getThreadDataContext();

    I'm just making sure I'm understanding you correctly.

    Thanks!

    Jonathan

    >>> andru..bjectstyle.org 2005-06-22 2:13:07 PM >>>
    Paul,

    Cache settings have effect on the shared cache in a multiuser app. For
    a
    single session DataContext (or rather its ObjectStore) has no upper
    limit
    on the number of cached objects as it is designed to have a shorter
    life
    span.

    So a more realistic performance test would actually discard a
    DataContext
    and create a new one after a few operations (how many is "few" depends
    on
    your expected usage patterns).

    FYI: Here is the stack structure (default is level 2):
    http://objectstyle.org/cayenne/userguide/design/caching.html

    Andrus

    > Hi Andrus,
    >
    > I'm seeing behaviour in my app using Cayenne, where it runs slower
    and
    > slower
    > the longer the application runs without a restart. I suspect that it
    will
    > eventually run out of memory. Upon restart, performance starts out
    high
    > again.
    >
    > I wrote a very simple test application to rule out any of my custom
    code.
    > It
    > simply registers a new objects with the DataContext, sets a property,
    and
    > calls commitChanges. The test app prints out the elapsed time for
    every
    > 1000
    > iterations. The results are here:
    >
    > http://www.buzzsurf.com/java/cayenne/results.txt
    >
    > If you want to run the simple test application yourself, it's here:
    >
    > http://www.buzzsurf.com/java/cayenne/CayennePerfTest.zip
    >
    > As you can see, performance degrades linearly over time. It seems
    like
    > DataContext is caching a pointer to every object created, despite my
    cache
    > settings?? I've been playing with the "Max Number of Objects"
    setting in
    > the
    > Modeler, but different settings seem to have no effect.
    >
    > -Paul
    >
    >
    >

    ______________________________________________________________________
    This email has been scanned by the MessageLabs Email Security System.
    For more information please visit http://www.messagelabs.com/email
    ______________________________________________________________________

    ______________________________________________________________________
    This email and any files transmitted with it are confidential and
    intended solely for the use of the individual or entity to whom they
    are addressed. If you have received this email in error please notify
    the system manager.

    Katun Corporation -- www.katun.com
    _____________________________________________________________________



    This archive was generated by hypermail 2.0.0 : Wed Jun 22 2005 - 15:49:06 EDT