Subject | Re: [firebird-support] Memory consumption / Database file size |
---|---|
Author | Bergeron Johanny |
Post date | 2008-10-30T11:04:01Z |
Hello, thanks for your answer.
I tried to find a way to reproduce the crash of the server without
success. It happens sometimes but it is still rare.
Also I have found why fbserver is eating all my memory :
I am using Delphi for my client application with the ADO components
(that access to the odbc driver).
Exemple of code that cause memory leak on the FB server :
*query := TADOQuery.create(nil);
try
query.Connection := MyDatabase.DBConnection; ///just assign
the database connection to the query/
i := 0;
while i < 20000 do
begin
current_query.SQL.Clear;
current_query.SQL.Add('ksldjfgslkdjgsldkgjslkgjslkgjsldkgj');
///Here we just assign a query and not execute it/
Inc(i)
end;
finally
current_query.free;
end;
*
In this code, we assign a query that is not executed. This lead to
memory leak on the FB server even if we destroy the query object on the
client side.
I tried this on a MySQL server and this has no effect on the server memory.
The example as it is, is not really usefull, but it can be usefull to
assign more than one query to the SQL string list and not execute all of
them.
I am still running load/performance tests to see if it has some effect
on the database file.
Johanny
[Non-text portions of this message have been removed]
I tried to find a way to reproduce the crash of the server without
success. It happens sometimes but it is still rare.
Also I have found why fbserver is eating all my memory :
I am using Delphi for my client application with the ADO components
(that access to the odbc driver).
Exemple of code that cause memory leak on the FB server :
*query := TADOQuery.create(nil);
try
query.Connection := MyDatabase.DBConnection; ///just assign
the database connection to the query/
i := 0;
while i < 20000 do
begin
current_query.SQL.Clear;
current_query.SQL.Add('ksldjfgslkdjgsldkgjslkgjslkgjsldkgj');
///Here we just assign a query and not execute it/
Inc(i)
end;
finally
current_query.free;
end;
*
In this code, we assign a query that is not executed. This lead to
memory leak on the FB server even if we destroy the query object on the
client side.
I tried this on a MySQL server and this has no effect on the server memory.
The example as it is, is not really usefull, but it can be usefull to
assign more than one query to the SQL string list and not execute all of
them.
I am still running load/performance tests to see if it has some effect
on the database file.
Johanny
[Non-text portions of this message have been removed]