Re: Memory Usage and OpenBSD

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Memory Usage and OpenBSD
Дата
Msg-id 20100210074209.GB18442@svana.org
обсуждение исходный текст
Ответ на Re: Memory Usage and OpenBSD  (Anton Maksimenkov <anton200@gmail.com>)
Ответы Re: Memory Usage and OpenBSD  (Anton Maksimenkov <anton200@gmail.com>)
Re: Memory Usage and OpenBSD  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Tue, Feb 09, 2010 at 08:19:51PM +0500, Anton Maksimenkov wrote:
> It means that on openbsd i386 we have about 2,2G of virtual space for
> malloc, shm*. So, postgres will use that space.
>
> But mmap() use random addresses. So when you get big chunk of memory
> for shared buffers (say, 2G) then you may get it somewhere in middle
> of virtual space (2,2G).

This is essentially the reason why it's not a good idea to use really
large amounts of shared_buffers on 32-bit systems: there isn't the
address space to support it.

> Can anybody briefly explain me how one postgres process allocate
> memory for it needs?
> I mean, what is the biggest size of malloc() it may want? How many
> such chunks? What is the average size of allocations?

There's no real maximum, as it depends on the exact usage. However, in
general postgres tries to keep below the values in work_mem and
maintainence_workmem. Most of the allocations are quite small, but
postgresql has an internal allocator which means that the system only
sees relatively large allocations. The majority will be in the order of
tens of kilobytes I suspect.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Вложения

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: dump of 700 GB database
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Best way to handle multi-billion row read-only table?