You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make firebird.conf empty and then add into it the single line:
StatementTimeout = 7200
Restart FB service.
Run some tool that can show memory consumprion per process, e.g. ProcessExplorer (on Windows).
Try following example (it will run infinitely so one need to cancel it via Ctrl-Break):
set list on;
set bail on;
shell del e:\temp\tmp4test.fdb 2>nul;
create database 'localhost:e:\temp\tmp4test.fdb' user sysdba password 'masterkey';
select *
from rdb$config where rdb$config_name = 'StatementTimeout';
set term ^;
execute block as
declare i int = 0;
declare res int;
begin
while (1 = 1) do
begin
-- execute statement ( 'select rand() from rdb$database' ) -- [1] constant
-- execute statement ( 'select ' || 1 || ' from rdb$database' ) -- [2] constant
execute statement ( 'select ' || rand() || ' from rdb$database' ) -- [3] growth
into res;
i = i + 1;
end
end
^
set term ;^
Watch into details for firebird process in ProcessExplorer (swich to 'performance graph').
You will see somth like:
No such problem if we comment out parameter 'StatementTimeout' in the firebird.conf.
Checked on 6.0.0.315.
PS.
I was unable to determine the exact value of the threshold of the number of unique expressions, after exceeding which memory growth begins. I checked MOD(i, N) function (instead of rand()) where N had different values.
It seemed firstly that N is ~16, but then i get results with constant memory consumption for greater values (i.e. for N = 17, 33, 67, 129 etc).
The text was updated successfully, but these errors were encountered:
hvlad
changed the title
Presense of StatementTimeout > 0 causes to memory growth in case of loop with unique expressions runing via ES
Memory leak when executing a lot of different queries and StatementTimeout > 0
Apr 17, 2024
I was unable to determine the exact value of the threshold of the number of unique expressions, after exceeding which memory growth begins. I checked MOD(i, N) function (instead of rand()) where N had different values.
It seemed firstly that N is ~16, but then i get results with constant memory consumption for greater values (i.e. for N = 17, 33, 67, 129 etc).
16 is the number of statements cached by external connection. I.e. statements was reused and no memory leak could be detected, while it actually there - near 40 bytes per statement.
Make firebird.conf empty and then add into it the single line:
Restart FB service.
Run some tool that can show memory consumprion per process, e.g. ProcessExplorer (on Windows).
Try following example (it will run infinitely so one need to cancel it via Ctrl-Break):
Watch into details for firebird process in ProcessExplorer (swich to 'performance graph').
You will see somth like:
No such problem if we comment out parameter 'StatementTimeout' in the firebird.conf.
Checked on 6.0.0.315.
PS.
I was unable to determine the exact value of the threshold of the number of unique expressions, after exceeding which memory growth begins. I checked MOD(i, N) function (instead of rand()) where N had different values.
It seemed firstly that N is ~16, but then i get results with constant memory consumption for greater values (i.e. for N = 17, 33, 67, 129 etc).
The text was updated successfully, but these errors were encountered: