From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Improving the memory allocator |
Date: | 2011-04-26 00:41:34 |
Message-ID: | 201104260241.35445.andres@anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tuesday, April 26, 2011 02:22:34 AM Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Mon, Apr 25, 2011 at 5:45 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> >> [ lots of awesome test results ]
> >
> > Very interesting work. I think it's interesting that there is so much
> > allocation happening inside MessageContext; I barely knew that
> > existed, let alone that it was a hotspot for memory allocation.
>
> The reason it shows as a hotspot is that parsing and planning happen in
> that context for the simple-Query code path. You'd get different
> answers if you were using extended-query protocol, or running prepared
> statements, or doing the bulk of your work in plpgsql, etc etc.
>
> It would be interesting if Andres could dig down another level or so in
> the call stack to see where the list creations etc are called from, but
> I'll bet quite a bit that what we're looking at is mostly parse/plan
> activity. (The high showing of bitmapset activity is a dead tipoff for
> planner, in particular, since that datatype is hardly used at all
> elsewhere.)
Currently thats just output via
#define MemoryContextAlloc(context, size) \
TraceMemoryContextAlloc(context, size, __FILE__, __FUNCTION__, __LINE__, \
__builtin_constant_p(size))
which in turn then calls the ordinary MemoryContextAlloc (yes, ugly I know).
But I guess it shouldn't be a problem to get more information...
Andres
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2011-04-26 00:54:08 | Re: branching for 9.2devel |
Previous Message | Andrew Dunstan | 2011-04-26 00:37:58 | Re: branching for 9.2devel |