cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Øyvind Harboe" <oyvind.har...@zylin.com>
Subject Re: Memory usage and select statements
Date Mon, 30 Jun 2008 12:46:17 GMT
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

Mime
View raw message