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