Re: plpgsql memory leaks

2024-01-12 Thread Pavel Stehule
Hi pá 12. 1. 2024 v 22:25 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > default master branch - res 190MB ram > > jit_inline_above_cost = -1 doesn't helps > > disabling JIT doesn't helps too, > > > so it looks like the wrong hypothesis , and the problem is maybe > somewhere > > else :

Re: plpgsql memory leaks

2024-01-12 Thread Tom Lane
Pavel Stehule writes: > default master branch - res 190MB ram > jit_inline_above_cost = -1 doesn't helps > disabling JIT doesn't helps too, > so it looks like the wrong hypothesis , and the problem is maybe somewhere > else :-/ I see no leak with these examples on HEAD, either with or without --

Re: plpgsql memory leaks

2024-01-12 Thread Pavel Stehule
pá 12. 1. 2024 v 14:53 odesílatel Michael Banck napsal: > Hi, > > On Fri, Jan 12, 2024 at 01:35:24PM +0100, Pavel Stehule wrote: > > pá 12. 1. 2024 v 11:54 odesílatel Michael Banck napsal: > > > Which version of Postgres is this and on which platform/distribution? > > > > It was tested on master

Re: plpgsql memory leaks

2024-01-12 Thread Michael Banck
Hi, On Fri, Jan 12, 2024 at 01:35:24PM +0100, Pavel Stehule wrote: > pá 12. 1. 2024 v 11:54 odesílatel Michael Banck napsal: > > Which version of Postgres is this and on which platform/distribution? > > It was tested on master branch (pg 17) on Fedora 39 > > > Did you try keep jit on but set ji

Re: plpgsql memory leaks

2024-01-12 Thread Pavel Stehule
pá 12. 1. 2024 v 11:54 odesílatel Michael Banck napsal: > Hi, > > On Fri, Jan 12, 2024 at 11:02:14AM +0100, Pavel Stehule wrote: > > pá 12. 1. 2024 v 10:27 odesílatel Pavel Stehule > > > napsal: > > > > > Hi > > > > > > I have reported very memory expensive pattern: > > [...] > > > > takes lot o

Re: plpgsql memory leaks

2024-01-12 Thread Michael Banck
Hi, On Fri, Jan 12, 2024 at 11:02:14AM +0100, Pavel Stehule wrote: > pá 12. 1. 2024 v 10:27 odesílatel Pavel Stehule > napsal: > > > Hi > > > > I have reported very memory expensive pattern: [...] > > takes lot of megabytes of memory too. > > The megabytes leaks are related to JIT. With JIT o

Re: plpgsql memory leaks

2024-01-12 Thread Pavel Stehule
pá 12. 1. 2024 v 10:27 odesílatel Pavel Stehule napsal: > Hi > > I have reported very memory expensive pattern: > > CREATE OR REPLACE FUNCTION public.fx(iter integer) > RETURNS void > LANGUAGE plpgsql > AS $function$ > declare > c cursor(m bigint) for select distinct i from generate_series(1,

plpgsql memory leaks

2024-01-12 Thread Pavel Stehule
Hi I have reported very memory expensive pattern: CREATE OR REPLACE FUNCTION public.fx(iter integer) RETURNS void LANGUAGE plpgsql AS $function$ declare c cursor(m bigint) for select distinct i from generate_series(1, m) g(i); t bigint; s bigint; begin for i in 1..iter loop open c