Page 1 of 1

Memory usage

Posted: Thu 29 Jul 2010 08:13
by sandy771
I have an application that works with very large databases, I use the UniDac component to connect an sqlite database (although this could change) to a various DevExpress components.

I am finding that some actions generate an out of memory error and I am trying to optimise my program. I wondered whether there is a list anywhere of which methods or properties increase the memory footprint of the UniDac, i.e. what methods should I avoid calling or what properties should I avoid setting.

Posted: Mon 02 Aug 2010 11:13
by bork
Hello

If you don't need to show your data in DBGrid, then you can set the UniDirectional property to True and the FetchRows property will indicate how many records will be loaded to the memory at the same time. It allows not to load all large table to the memory. But this way has limitations: you can use the TUniQuery.Next method, but cannot use the TUniQuery.Previous method (and DBGrid because it uses the Previous method).

Also you should keep in mind that TUniQuery (or TUniTable) releases memory on the Close method calling. So after using large table that was loaded to the memory you should close dataset to release memory.

And if you use the DevExpress components, then you should tune them up to deny loading all records to the memory.