Re: 9.5: Better memory accounting, towards memory-bounded HashAgg

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: 9.5: Better memory accounting, towards memory-bounded HashAgg
Дата
Msg-id 20141117170455.GK27042@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: 9.5: Better memory accounting, towards memory-bounded HashAgg  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: 9.5: Better memory accounting, towards memory-bounded HashAgg  (Tomas Vondra <tv@fuzzy.cz>)
Re: 9.5: Better memory accounting, towards memory-bounded HashAgg  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Hi,

On 2014-11-16 23:31:51 -0800, Jeff Davis wrote:
> *** a/src/include/nodes/memnodes.h
> --- b/src/include/nodes/memnodes.h
> ***************
> *** 60,65 **** typedef struct MemoryContextData
> --- 60,66 ----
>       MemoryContext nextchild;    /* next child of same parent */
>       char       *name;            /* context name (just for debugging) */
>       bool        isReset;        /* T = no space alloced since last reset */
> +     uint64        mem_allocated;    /* track memory allocated for this context */
>   #ifdef USE_ASSERT_CHECKING
>       bool        allowInCritSection;    /* allow palloc in critical section */
>   #endif

That's quite possibly one culprit for the slowdown. Right now one
AllocSetContext struct fits precisely into three cachelines. After your
change it doesn't anymore.

Consider not counting memory in bytes but blocks and adding it directly
after the NodeTag. That'd leave the size the same as right now.

Greetings,

Andres Freund

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: 9.5: Better memory accounting, towards memory-bounded HashAgg
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}