Re: Memory context usage - Mailing list pgsql-hackers

From Adriano Lange
Subject Re: Memory context usage
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: Memory context usage  (Greg Smith <[email protected]>)
Responses Re: Memory context usage
List pgsql-hackers
On Fri, Aug 28, 2009 at 5:18 AM, Greg Smith<[email protected]> wrote:
> On Fri, 28 Aug 2009, Tom Lane wrote:
>
>> MemoryContextStats() might help.  It just dumps the info to stderr
>> though.
>
> Which means it ends up in the database log files in the common configuration
> where where the database's stderr is redirected to there. I even script
> running this regularly against stuff I'm suspicious of, using something like
> this passed the PID of the process I want to watch:
>
> #!/bin/bash
> gdb -p $1 <<EOF
> p MemoryContextStats(TopMemoryContext)
> detach
> quit
> EOF
>
> --
> * Greg Smith [email protected] http://www.gregsmith.com Baltimore, MD
>

Is there another way to get it in the source code?
I need to control the size of a memory context on the fly and take
some actions when
the used memory exceeds a defined size.

Thanks

Adriano


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: 8.5 release timetable, again
Next
From: Alvaro Herrera
Date:
Subject: Re: 8.5 release timetable, again