strong memory leak in plpgsql from handled rollback and lazy cast - Mailing list pgsql-hackers

From Pavel Stehule
Subject strong memory leak in plpgsql from handled rollback and lazy cast
Date
Msg-id CAFj8pRDmap0kBSKC_bW+Q7eZo46+SP08wC1rYJjHWaiVpo_5rg@mail.gmail.com
Whole thread Raw
Responses Re: strong memory leak in plpgsql from handled rollback and lazy cast
List pgsql-hackers
Hi

When I tested some hypothesis I wrote buggy code. It was surprise how fast I lost all free memory

do $$                  
begin
  for i in 1..3000000
  loop
    begin
      -- do some error
      if i then end if;
    exception when others then
      -- do nothing
    end;
  end loop;
end;
$$;

problem is somewhere in implicit casting inside IF statement. When I use explicit casting -

  IF i::boolean THEN

then there is not memory leak.

Regards

Pavel

pgsql-hackers by date:

Previous
From: Anastasia Lubennikova
Date:
Subject: Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.
Next
From: Robert Haas
Date:
Subject: Re: block-level incremental backup