Re: Memory Context Info dump

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Memory Context Info dump
Date: 2015-09-08 16:23:03
Message-ID: CAM-w4HMYKKzMxcuLn5wUjPRZCDEFHOVsVxFwhBpb2DJ8rKECQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 8, 2015 at 4:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> As an example of potentially-more-useful aids, I'm wondering about
> tracking the high-water memory consumption of each memory context.
> (This probably wouldn't be terribly expensive if it were done at the
> granularity of malloc requests rather than individual pallocs.)
> Then perhaps something to log a context's peak usage at context
> destruction time, if it exceeds some threshold or other.

What I've been itching for in my testing is a way to save the memory
context stats, and then later print the difference between them. That
would let me see where memory was actually going to.

There are some cases where that could be tricky. If a context is
destroyed and a new one by the same name is created is it the same
context or a different one? If there are a bunch with the same name
and later there are a bunch but some are the same context and some are
new do we try to match them up, maybe sort by size?

But it would be nice to be able to see right away what context the
extra memory was allocated in between two points.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-09-08 16:33:39 Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx
Previous Message Jeff Janes 2015-09-08 16:03:46 Re: pgbench progress with timestamp