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 CAA4eK1Ju1VSECBQfOcqMfJ_1UBK-vcSqL7snuFz31QOMdMk_bQ@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>)
List pgsql-hackers
On Wed, Jun 18, 2014 at 10:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amit Kapila <amit.kapila16@gmail.com> writes:
> > 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?
>
> We do not have control over mallocs done by third-party code
> (think pl/perl for example).  

Yeah, mallocs done by third-party code would be difficult to track,
one possibility could be that we expose a built-in memory allocator
function.  I think it will lead to change in third-party code who wants
to use this new feature.  However if thats not viable then we need to
think about some OS specific calls like the one you have suggested
above (sbrk(0)), but I think that solution might also need to have
portable API for Windows.


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

pgsql-hackers by date:

Previous
From: Mitsumasa KONDO
Date:
Subject: Re: gaussian distribution pgbench
Next
From: Craig Ringer
Date:
Subject: include_dir catch-22