Re: unconstrained memory growth in long running procedure stored procedure after upgrading 11-12

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: unconstrained memory growth in long running procedure stored procedure after upgrading 11-12
Дата
Msg-id 20210331040751.GU4431@telsasoft.com
обсуждение исходный текст
Ответ на unconstrained memory growth in long running procedure stored procedure after upgrading 11-12  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
On Tue, Mar 30, 2021 at 04:17:03PM -0500, Merlin Moncure wrote:
> Instructions:
> 1. run the attached script in psql, pgtask_test.sql. It will create a
> database, initialize it, and run the main procedure. dblink must be
> available
> 2. in another window, run SELECT CreateTaskChain('test', 'DEV');

For your reproducer, I needed to:  
1.1) comment this:
|INSERT INTO Task SELECT
|  -- 'test',
1.2) then run: CALL MAIN();

Anyway I reproduced this without an extension this time:

CREATE OR REPLACE FUNCTION cfn() RETURNS void LANGUAGE PLPGSQL AS $$ declare a record; begin FOR a IN SELECT
generate_series(1,99)LOOP PERFORM format('select 1'); END LOOP; END $$;
 
$ yes 'SET jit_above_cost=0; SET jit_inline_above_cost=0; SET jit=on; SET client_min_messages=debug; SET
log_executor_stats=on;SELECT cfn();' |head -11 |psql 2>&1 |grep 'max resident'
 
!       33708 kB max resident size
!       35956 kB max resident size
!       37800 kB max resident size
!       40300 kB max resident size
!       41928 kB max resident size
!       43928 kB max resident size
!       48496 kB max resident size
!       48964 kB max resident size
!       50460 kB max resident size
!       52272 kB max resident size
!       53740 kB max resident size

There's also a relatively microscopic leak even if inline is off.  It may be
that this is what I reproduced last time - I couldn't see how a few hundred kB
leak was causing a our process to be GB sized.  It may or may not be a separate
issue, though.

-- 
Justin



В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: What to call an executor node which lazily caches tuples in a hash table?
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: extra semicolon in postgres_fdw test cases