BUG #4677: memory growth - Mailing list pgsql-bugs

From aiwaniuk
Subject BUG #4677: memory growth
Date
Msg-id 200902261515.n1QFFspG020306@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4677: memory growth  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4677
Logged by:          aiwaniuk
Email address:      aiwaniuk@instytut.com.pl
PostgreSQL version: >8.0
Operating system:   linux
Description:        memory growth
Details:

i postgres version 8.2, 8.3 and probobly 8.1 there is problem with running
VOLATILE  plpgsql function with begin - exception checking that performs
other VOLATILE  plpgsql function. if either, first or second performing
removed, problem doesn't shows. here's an example

CREATE FUNCTION info.f()
  RETURNS void AS
$BODY$
DECLARE
  tmp text;
BEGIN
  -- do anything
  tmp = md5(random()::text) || md5(random()::text);
  RETURN;
END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;

CREATE or replace FUNCTION info.memory_growth(i_max integer)
  RETURNS integer AS
$BODY$
DECLARE
  i integer;
BEGIN
  i = 0;
  WHILE  i < i_max  LOOP

    BEGIN
      PERFORM info.f();
    EXCEPTION
      WHEN OTHERS THEN
        --
    END;

    PERFORM info.f();

    i = i + 1;
  END LOOP;

  RETURN i;
END;$BODY$
  LANGUAGE 'plpgsql' VOLATILE;

after running
select info.memory_growth(100000);

please take a look how's memory of client process grows. is there some
logical problem how functions are create ?

pgsql-bugs by date:

Previous
From: 田中 裕一
Date:
Subject: Re: BUG #4674: Unable to open lob
Next
From: Tom Lane
Date:
Subject: Re: BUG #4677: memory growth