Re: rethinking dense_alloc (HashJoin) as a memory context

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: rethinking dense_alloc (HashJoin) as a memory context
Date: 2016-07-18 14:32:02
Message-ID: 22452.1468852322@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <stark(at)mit(dot)edu> writes:
> I wonder if we could go further. If we don't imagine having a very
> large number of allocators then we could just ask each one in turn if
> this block is one of theirs and which context it came from. That would
> allow an allocator that just allocated everything in a contiguous
> block to recognize pointers and return the memory context just by the
> range the pointer lies in.

The performance problem is not "large number of allocators", it's "large
number of distinct memory ranges". Also, this will fail utterly to
recognize duplicate-pfree and bad-pointer cases. Not that the existing
method is bulletproof, but this way has zero robustness against caller
bugs.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2016-07-18 14:37:06 Re: DO with a large amount of statements get stuck with high memory consumption
Previous Message Tom Lane 2016-07-18 14:28:17 Re: DO with a large amount of statements get stuck with high memory consumption