BUG #17422: Memory leak

Started by PG Bug reporting formabout 4 years ago2 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 17422
Logged by: Vitaly Stoyan
Email address: vitstn@gmail.com
PostgreSQL version: 13.6
Operating system: any
Description:

https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/utils/adt/json.c#L83

It seems memory allocated by palloc for lex variable isn't freed

#2Andres Freund
andres@anarazel.de
In reply to: PG Bug reporting form (#1)
Re: BUG #17422: Memory leak

On 2022-03-01 17:06:02 +0000, PG Bug reporting form wrote:

The following bug has been logged on the website:

Bug reference: 17422
Logged by: Vitaly Stoyan
Email address: vitstn@gmail.com
PostgreSQL version: 13.6
Operating system: any
Description:

https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/utils/adt/json.c#L83

It seems memory allocated by palloc for lex variable isn't freed

In a lot of places we free memory in bulk by resetting memory contexts. See
https://github.com/postgres/postgres/blob/master/src/backend/utils/mmgr/README

Greetings,

Andres Freund