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