Memory usage

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Memory usage

Post by sandy771 » Thu 29 Jul 2010 08:13

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.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 02 Aug 2010 11:13

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.

Post Reply