Re: BUG #18675: Postgres is not realasing memory causing OOM - Mailing list pgsql-bugs

From Daniel Gustafsson
Subject Re: BUG #18675: Postgres is not realasing memory causing OOM
Date
Msg-id 5232B290-5C90-4819-A0F6-A07DE14A20C4@yesql.se
Whole thread Raw
In response to Re: BUG #18675: Postgres is not realasing memory causing OOM  (Maciej Jaros <eccenux@gmail.com>)
List pgsql-bugs
> On 31 Oct 2024, at 13:21, Maciej Jaros <eccenux@gmail.com> wrote:

> >> We terminate all queries running longer than 30 minutes....
> > That just supports my speculation this is not the in-query memory leak where we allocate memory in a memory
context,because that'd be freed at the end of a query. I'm not sure about what happens to memory allocated by LLVM if a
querygets interrupted because of a timeout. How often do queries hit the 30-minute limit? 
>
> Very rarely. Aside from bad deployments, long-running query kills happen maybe once a week or even once a month. It
dependson the load (e.g. had more last month due to the beginning of the school year). 

The LLVMContextRef remains, currently for 100 queries as a heuristic since at
time ot of the OOM fix commit there was no way of interrogating LLVM for how
large the memory context was.

IIRC this memory leak (which is capped in 16.4) only happens when performing
inlining, raising the cost limit for inlining with jit_inline_above_cost and
re-running problematic queries could give interesting insights.

--
Daniel Gustafsson




pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18681: [ECPG] heap-read-out-of-bounds
Next
From: Heikki Linnakangas
Date:
Subject: Re: Detection of hadware feature => please do not use signal