Re: EXPERIMENTAL: mmap-based memory context / allocator

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: EXPERIMENTAL: mmap-based memory context / allocator
Дата
Msg-id 54E0FF4E.4010400@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: EXPERIMENTAL: mmap-based memory context / allocator  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
On 15.2.2015 21:13, Andres Freund wrote:
> On 2015-02-15 21:07:13 +0100, Tomas Vondra wrote:
>
>> malloc() does that only for allocations over MAP_THRESHOLD, which
>> is 128kB by default. Vast majority of blocks we allocate are <=
>> 8kB, so mmap() almost never happens.
> 
> The problem is that mmap() is, to my knowledge, noticeably more 
> expensive than sbrk(). Especially with concurrent workloads. Which is
> why the malloc/libc authors chose to use sbrk ...

Any ideas how to simulate such workloads? None of the tests I've done
suggested such issue exists.

> IIRC glibc malloc also batches several allocation into mmap()ed
> areas after some time.

Maybe, there's certainly a lot of such optimizations in libc. But how do
you return memory to system in that case?

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



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: EXPERIMENTAL: mmap-based memory context / allocator
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Allow "snapshot too old" error, to prevent bloat