Re: Memory usage and select statements

From: Øyvind Harboe (oyvind.harbo..ylin.com)
Date: Mon Jun 30 2008 - 08:46:17 EDT

  • Next message: Øyvind Harboe: "Loading small tables into memory for the application lifetime"

    I discovered that for some of the cases it is the relationships that
    actually cause the massive memory consumption, not the
    unused columns.

    Once I realized this, I modified my app to do the following:

    - perform a normal query. Everything into memory using a normal query.
    - do some simple checks on each object to see if it requires processing
    - if the object requires processing (evaluation of relationships), then first
    create a datacontext for every object to be processed and then use
    DataContext.localObject() & process the object within the newly
    created DataContext.
    - everything is now nicely garbage collected while at the same time
    using a sensible amount of memory to speeed up the Java code
    that does the selection of which records to process

    Being able to select which columns to load on demand will be
    important elsewhere though.

    -- 
    Øyvind Harboe
    http://www.zylin.com/zy1000.html
    ARM7 ARM9 XScale Cortex
    JTAG debugger and flash programmer
    



    This archive was generated by hypermail 2.0.0 : Mon Jun 30 2008 - 08:46:53 EDT