Re: Typo in bufmgr.c that result in waste of memory

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Typo in bufmgr.c that result in waste of memory
Дата
Msg-id CANP8+jKYgenEEKu+HP=X=+crk5Gat6K=y3w0G8+u5QPtX8++SA@mail.gmail.com
обсуждение исходный текст
Ответ на Typo in bufmgr.c that result in waste of memory  (Takashi Horikawa <t-horikawa@aj.jp.nec.com>)
Ответы Re: Typo in bufmgr.c that result in waste of memory  (Takashi Horikawa <t-horikawa@aj.jp.nec.com>)
Re: Typo in bufmgr.c that result in waste of memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 19 February 2016 at 02:58, Takashi Horikawa <t-horikawa@aj.jp.nec.com> wrote:
 
I have just found a typo in the source code (not in a comment) of bufmgr.c
that result in waste of memory. It might be a 'bug' but it does not result
in any incorrect operation but just results in waste of a few memory
resource.

As sizeof(PrivateRefCountArray) found in InitBufferPoolAccess() is 64 and
sizeof(PrivateRefCountEntry) which should be used here is 8, this typo
produces 56 byte of unused memory area per one PrivateRefCount entry in the
hash table. I think this result in not only the waste of memory but also
reduces the cache hit ratio.

X    hash_ctl.entrysize = sizeof(PrivateRefCountArray);
O    hash_ctl.entrysize = sizeof(PrivateRefCountEntry);

I see the problem, but I don't buy the argument that it wastes large amounts of memory. Or do you have some evidence that it does?

I think we should fix it, but not backpatch.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: checkpointer continuous flushing - V16
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Bug in StartupSUBTRANS