I have build in Delphi 2006 a very little test application with one dbgrid, one TZQuerys and one connection to MySQL4.
When I run the application, the memory usage (seen in Taskmanager) swaps between 4.460 KB (no TZQuery active) to 55 MB up to 250 MB, depending on the number of rows in the table. (The maximum no. is 10 rows!)
If I perform the SQL-Query for 10 rows direct in PHPMyAdmin and export the result as XML, the file is only 13 KB!
Do you have an idea, why the components uses so much memory?
On systems with low memory, windows is swaping and is very slow.
bye
Alfonso
Too much memory usage
Moderators: gto, cipto_kh, EgonHugeist
The memory leak comes only with "IF" inside a &quo
I have this SQL Statement:
With this query, the program uses very huge memory (200 MB and more).
If I remove the IF, like here:
The memory usage is now normal.
any idea? Is this a bug in ZEOS?
bye
Alfonso
Code: Select all
ZQContent.SQL.Text:='SELECT '+
'if(X_LineItemNote=" ",X_Bestelltext, ' +
'X_LineItemNote) AS Beschreibung ' +
'FROM CM_tbl_Content WHERE idHeader=:idHeader';
If I remove the IF, like here:
Code: Select all
ZQContent.SQL.Text:='SELECT '+
'X_LineItemNote AS Beschreibung ' +
'FROM CM_tbl_Content WHERE idHeader=:idHeader';
any idea? Is this a bug in ZEOS?
bye
Alfonso
The application is using the memory. MySQL is running on a external server.
Try to create a simple application with a grid and a TZQuery. Insert an IF, like I did.
We have this problem since we switched to Delphi 2006 and to Zeos 6.5.1.
I tried to chang the SQL statement deleting the WHERE clause: The Computer (with 1 GB Memory) runs out of memory!
As you say, it is no logical, why just a conditional line should affect memory usage, if the result is practically the same ...
But it is so.
bye
Alfonso
Try to create a simple application with a grid and a TZQuery. Insert an IF, like I did.
We have this problem since we switched to Delphi 2006 and to Zeos 6.5.1.
I tried to chang the SQL statement deleting the WHERE clause: The Computer (with 1 GB Memory) runs out of memory!
As you say, it is no logical, why just a conditional line should affect memory usage, if the result is practically the same ...
But it is so.
bye
Alfonso
Hello Alfonso,
perhaps MySQL can't determine the column size on the if statement and therefore reports a very large one. What column type is Beschreibung with and without if?
Perhaps you can use a typecast ( e.g. varchar(255))?
Sorry if i'm wrong, i don't have any experience with MySQL but imho it seems the first thing to check.
Best Regards,
Markus Dütting
perhaps MySQL can't determine the column size on the if statement and therefore reports a very large one. What column type is Beschreibung with and without if?
Perhaps you can use a typecast ( e.g. varchar(255))?
Sorry if i'm wrong, i don't have any experience with MySQL but imho it seems the first thing to check.
Best Regards,
Markus Dütting
Alfonso I suggest you strip down your program to the bare minimum required for someone else to try and replicate your bug and post it. Add the sql definitions, database versions etc.
Alfonso wrote:The application is using the memory. MySQL is running on a external server.
Try to create a simple application with a grid and a TZQuery. Insert an IF, like I did.
We have this problem since we switched to Delphi 2006 and to Zeos 6.5.1.
I tried to chang the SQL statement deleting the WHERE clause: The Computer (with 1 GB Memory) runs out of memory!
As you say, it is no logical, why just a conditional line should affect memory usage, if the result is practically the same ...
But it is so.
bye
Alfonso