Re: [BUGS] json(b)_array_elements use causes very large memory usage when also referencing entire json document - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] json(b)_array_elements use causes very large memory usage when also referencing entire json document
Date
Msg-id 5827.1507320802@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document  (Lucas Fairchild-Madar <lucas.madar@gmail.com>)
List pgsql-bugs
Lucas Fairchild-Madar <lucas.madar@gmail.com> writes:
> Is there any sort of setting right now that can defend against this? A way
> to prevent a query from using 20+GB of memory? I'd prefer the query fail
> before the database system is kill -9'd.

You could experiment with running the postmaster under a ulimit setting,
but the more traditional recommendation is to disable OOM kill, cf

https://www.postgresql.org/docs/current/static/kernel-resources.html#linux-memory-overcommit
        regards, tom lane


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Lucas Fairchild-Madar
Date:
Subject: Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] pg_logical_slot_peek_changes crashes postgres when called from inside pl/pgsql