Re: Built-in support for a memory consumption ulimit? - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Built-in support for a memory consumption ulimit?
Date
Msg-id CAA4eK1LC2tc5e0adeFt0g4Bd42wAO=AhMgiCJvEys0d33Q3TuA@mail.gmail.com
Whole thread Raw
In response to Re: Built-in support for a memory consumption ulimit?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Built-in support for a memory consumption ulimit?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Jun 18, 2014 at 2:09 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Robert Haas <robertmhaas@gmail.com> writes:
> > We could do better by accounting for memory usage ourselves, inside
> > the memory-context system, but that'd probably impose some overhead we
> > don't have today.
>
> Hm.  We could minimize the overhead if we just accounted for entire
> malloc chunks and not individual palloc allocations.  That would make
> the overhead not zero, but yet probably small enough to ignore.
>
> On the other hand, this approach would entirely fail to account for
> non-palloc'd allocations, which could be a significant issue in some
> contexts.

Won't it be possible if we convert malloc calls in backend code to
go through wrapper, we already have some precedents of same like
guc_malloc, pg_malloc?


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: xbzhang
Date:
Subject: Re: How to implement the skip errors for copy from ?
Next
From: Fujii Masao
Date:
Subject: Re: pg_stat directory and pg_stat_statements