Re: EXPERIMENTAL: mmap-based memory context / allocator - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: EXPERIMENTAL: mmap-based memory context / allocator
Date
Msg-id 54E0FA03.6010402@vmware.com
Whole thread Raw
In response to EXPERIMENTAL: mmap-based memory context / allocator  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: EXPERIMENTAL: mmap-based memory context / allocator  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
On 02/15/2015 08:57 PM, Tomas Vondra wrote:
> One of the wilder ideas (I mentined beer was involved!) was a memory
> allocator based on mmap [2], bypassing the libc malloc implementation
> altogether. mmap() has some nice features (e.g. no issues with returning
> memory back to the kernel, which may be problem with sbrk). So I hacked
> a bit and switched the AllocSet implementation to mmap().

glibc's malloc() also uses mmap() for larger allocations. Precisely 
because those allocations can then be handed back to the OS. I don't 
think we'd want to use mmap() for small allocations either. Let's not 
re-invent malloc()..

- Heikki




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: New CF app deployment
Next
From: Tomas Vondra
Date:
Subject: Re: EXPERIMENTAL: mmap-based memory context / allocator