On Wed, Jun 18, 2014 at 2:09 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > > Robert Haas <robertmh...@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