Re: 9.5: Better memory accounting, towards memory-bounded HashAgg - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: 9.5: Better memory accounting, towards memory-bounded HashAgg
Date
Msg-id CA+U5nMKeafiSUTR=gMkQfAAZwmrRmbr=7ga8Xk3hdbkvKo8Kuw@mail.gmail.com
Whole thread Raw
In response to Re: 9.5: Better memory accounting, towards memory-bounded HashAgg  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On 17 November 2014 07:31, Jeff Davis <pgsql@j-davis.com> wrote:

> To calculate the total memory used, I included a function
> MemoryContextMemAllocated() that walks the memory context and its
> children recursively.

If we assume that we want the results accurate to within 5%, then we
can work out a good sampling rate to achieve that accuracy.

We would probably need a counting mechanism that didn't slow down O(N)
as our allocations get bigger.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: double counting of lines in psql
Next
From: Simon Riggs
Date:
Subject: Re: using custom scan nodes to prototype parallel sequential scan