Zeos 6.6.6 + Delphi2006: need a lot of memory

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

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

Zeos 6.6.6 + Delphi2006: need a lot of memory

Postby Sapiem » 18.12.2011, 22:18

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

Postby Sapiem » 23.12.2011, 18:23

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:

Postby mdaems » 30.12.2011, 16:27

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

Postby Sapiem » 03.01.2012, 14:44

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:

Postby mdaems » 01.03.2012, 00:18

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

Postby Sapiem » 01.03.2012, 13:17

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:

Postby mdaems » 15.03.2012, 00:30

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

Mark
Image


Return to “SQLite”

Who is online

Users browsing this forum: No registered users and 1 guest