Zeos 6.6.6 + Delphi2006: need a lot of memory

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Zeos 6.6.6 + Delphi2006: need a lot of memory

Post by Sapiem »

I have been working with Delphi 2006 + Zeos 6.6.6 and use an encrypted 16Mb database with SQLite3 protocol (about 15000 records).

The executable is about 5Mb, but when a run it, it consume 15Mb, but when I open the encrypted database it use 88Mb !!!!

Why too memory...?
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

Deleting all Ztables and using only ZQuerys I can decrease all the memory consume up to 41Mb.

If you use Absolute Database, the same code and the same database structure and data, it only consume up to 17Mb, including 6 ABSTables opened with MasterSource option betwen them.

Why SQLite consume that?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Probably it's zeoslib that reserves more memory than needed for the data in the tables. It reserves the full capacity of string fields (eg 255 bytes for varchar(255)). So if you have a lot of big string fields which you rarely complete completely you'll see that much waste. You could also try to create forward only readonly datasets. These might waste less cache memory as they don't need an update cache.

Mark
Image
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

But I need search and update records in database all the time, so I prefer use ZQuery, not readonly datasets.

It´s different varchar(255) and TEXT fields? I mean, about this that you explain with the cache memory?

Thanks.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

I'd say yes, it's different as I think text is handled as a blob, but I don't know if that's more efficient in your case. You'll have to test that.

Mark
Image
Sapiem
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 14.11.2011, 20:21

Post by Sapiem »

It's less memory consumer, but not mark the diferent. Just we need to adapt to use it in this way, ja.

Thanks
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Does that mean: 'Yes, TEXT fields use less memory and behaviour is identical, so we will use TEXT fields'??

Mark
Image
Post Reply