Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] Minimum allocation size for managed_shared_memorty
From: Aditya Gadre (agadre_at_[hidden])
Date: 2010-11-29 11:08:57


> There is a fixed overhead for the header and another one for each
> allocation (bookeeping information for deallocation), another overhead
> for each named object (you need to store the name, and other
> information...). You can also have memory fragmentation (if you
> allocate/deallocate many objects), just like with heap memory and this
> overhead is use-dependent.
>
> Take in care that the OS will reserve shared memory in page units
> (usually 4KB-64KB bytes, depending on HW/OS) so creating a segment of
> 800 will waste a whole page. See mapped_region::get_page_size() to
> know the size of a page in your platform.
>
On my machine, the page size is 4096 bytes. In general, is it advisable
to allocate memory in multiples of the page size?
Thanks,
- Aditya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net