Page 1 of 1

increase memory size used by XE App with Zeos 7

Posted: 24.10.2013, 11:57
by afreitag
my application.exe build in Delphi XE with old good Zeos 6 takes 57 MB of RAM, after changing on Zeos 7.0.3 the same App (connected with the same DB) takes 200 MB RAM :shock: All is working fine but this size...
the same occurrence appears with Zeos 7.1.2, the same in Delphi XE3
(no matter compiling type Debug or Release)
does anybody knows any explanation of this occurrence ?
regards

Re: increase memory size used by XE App with Zeos 7

Posted: 24.10.2013, 15:48
by miab3
@afreitag

How have you built your application.exe in Delphi XE with old good Zeos 6?

Michal

Re: increase memory size used by XE App with Zeos 7

Posted: 28.10.2013, 12:13
by afreitag
with some changes in Zeos of course

Re: increase memory size used by XE App with Zeos 7

Posted: 29.10.2013, 17:12
by miab3
@afreitag,
with some changes in Zeos of course
Could you publish it?

At my:
ZEOS - Delphi - VSize
5.5 - D2006 - 76MB
7a - D2006 - 76MB
7.1.2 - D2006 - 86MB
7a - XE2(32)- 82MB
7.1.2 - XE2(32) - 102MB

Michal

Re: increase memory size used by XE App with Zeos 7

Posted: 29.10.2013, 20:36
by EgonHugeist
@miab3
miab3 wrote:ZEOS - Delphi - VSize
5.5 - D2006 - 76MB
7a - D2006 - 76MB
7.1.2 - D2006 - 86MB
7a - XE2(32)- 82MB
7.1.2 - XE2(32) - 102MB
Don't you see the UnicodeString does incraese the memory here?

Zeos is a global component. Actually i do assume chinese people with some 1-!6! bytes charecters do use Zeos too. I'm using a avage of 4Bytes in this case. Another thing can be the permant upconverting of the clob's to the UnicodeString in 7.0/7.1 which did change on 7.2.

I can NOT use minior memory or we've a buffer overrun for suche codepages like UTF8/GBK-simplified-chinese, Persian ..... as long i don't differ between UTF16LE/UTF16BE.
For single byte charsets (client-encoded) i need 2Bytes for the UnicodeString. It wasn't me who made the UnicodeString by default ask-> Embarcadero/CodeGear...
I just made it possible.

Re: increase memory size used by XE App with Zeos 7

Posted: 29.10.2013, 21:12
by miab3
@EgonHugeist,
Don't you see the UnicodeString does incraese the memory here?
But I know it.

Afreitag says that the use of memory has increased 400%.
For me has increased at most 40% and that between the version non-unicode and unicode.

Michal

Re: increase memory size used by XE App with Zeos 7

Posted: 29.10.2013, 21:18
by EgonHugeist
miab3

i think 6.6 did load the clobs on demand as i reintroduced it on 7.2. I can't say who wrote the "allways load all lobs" code before. As i worked on the EH-branch the code already persists. now i fixed id in a much more optimal way. If his fixes need minor mem than his fixes are only possible for HIS CP's not for a gloabal use of this component. Michal, how does 7.2 behaves with memory?

Btw-got a solution for MySQL-uncached lobs too. Not ready yet, i'm fighting with oracle to avoid the mem-moves (if possible??? -> ora oftenly uses InOut-Pointers which makes a bit trouble..)

Re: increase memory size used by XE App with Zeos 7

Posted: 29.10.2013, 21:50
by miab3
@EgonHugeist
Michal, how does 7.2 behaves with memory?
Decreased by a few percent.

FB2.53, Win7-64 Delphi XE2-32-64
7.1.2 -32bits - 192MB
7.2 -32bits - 181MB
7.1.2 -64bits - 250MB
7.2 - 64bits -236MB
(Another application than before)

Michal

Re: increase memory size used by XE App with Zeos 7

Posted: 30.10.2013, 13:06
by afreitag
I want to add that Application works with Postgresql DB, maybe Zeos supports this DB specifically, long time ago was a bug that Zeos truncate String only to 256 length.This may have been replaced by something more memory consuming ?

Re: increase memory size used by XE App with Zeos 7

Posted: 30.10.2013, 17:13
by miab3
@afreitag

That's right.
Add 'Undefined_Varchar_AsString_Length = 255' to the TZConnection.Properties, reconnect and you have the old behavior back.
It will only read up to 255 characters in the field (if you want this).

Could you paste your modified ZEOS 6.6?

Michal