Re: OOM kill in xmlelement() with large arrays

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Kirill Reshke <reshkekirill(at)gmail(dot)com>
Subject: Re: OOM kill in xmlelement() with large arrays
Date: 2026-11-25 13:12:35
Message-ID: 4D01C502-85EA-439A-B28A-93FDEB490600@yesql.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 25 Nov 2026, at 14:01, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com> wrote:

> +1 to fixing this. Patch LGMT, maybe just two tiny things:
>
> - perhaps move MemoryContext oldcxt to the loop
> - "map_sql_value_to_xml_value temporary cxt" is a bit lengthy blob, maybe
> "elements of XML array" would suffice there (or maybe check further wihtin
> pg_backend_memory_contexts for better examples)

+1. Patch looks good on a first glance, expanding to the *_to_xml cases seems
like a good idea.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abraham Pérez 2026-11-25 13:13:29 Re: Fix trigger memory leak
Previous Message Chengpeng Yan 2026-11-25 13:09:18 Re: Preserve presorted ORDER BY keys when reordering DISTINCT ON keys