strong memory leak in plpgsql from handled rollback and lazy cast

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: strong memory leak in plpgsql from handled rollback and lazy cast
Date: 2019-09-17 16:50:35
Message-ID: CAFj8pRDmap0kBSKC_bW+Q7eZo46+SP08wC1rYJjHWaiVpo_5rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-09-17 16:58:23 Re: block-level incremental backup
Previous Message Anastasia Lubennikova 2019-09-17 16:43:35 Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.