Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High memory usage when PSQL code SELECT's from stored procedure which modified some data [CORE3895] #4231

Closed
firebird-automations opened this issue Jul 23, 2012 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @hvlad

Test case:

1. create metadata
create table t (id integer not null);

set term ^;

create or alter procedure selproc (p_id integer) returns (id integer)
AS
begin
insert into t values (:p_id);
id = p_id;
suspend;
end
^

create or alter procedure main returns (id integer)
as
declare I integer = 0;
begin
while (i < 1000) do begin
select id from selproc(:i) into :id;
i = i + 1;
end
suspend;
end
^

set term ;^

2. run test and look at memory usage (below i removed not needed stats)
set stat on;

SQL> select * from main;

      ID

============
999

Current memory = 4852448
Delta memory = 257764
Max memory = 4859608

SQL> select * from main;

      ID

============
999

Current memory = 4961764
Delta memory = 109316
Max memory = 4974260

SQL> select * from main;

      ID

============
999

Current memory = 5071132
Delta memory = 109368
Max memory = 5081956

you see - memory usage is incremented at each run by 109368 bytes

SQL> commit;
Current memory = 4735108
Delta memory = -336024
Max memory = 5081956

memory is returned on commit. But it shoud be returned at the statement execution finish.

If replace "select from selproc" by "execute procedure selproc" then there is no such high memory usage.

Commits: 3ec82bd cf91de6 f221651

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

Version: 2.1.5 [ 10420 ]

Version: 2.1.4 [ 10361 ]

Version: 2.5.0 [ 10221 ]

Version: 2.1.3 [ 10302 ]

Version: 2.1.2 [ 10270 ]

Version: 2.1.1 [ 10223 ]

Version: 2.1.0 [ 10041 ]

Version: 2.5.2 [ 10450 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.5.3 [ 10461 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1.6 [ 10460 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Deferred

Test Details: Waiting for reply from hvlad, letter 16.11.2016 09:20.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Deferred => Done successfully

Test Details: Waiting for reply from hvlad, letter 16.11.2016 09:20. =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment