[Interest] memory fragmentation?

Harri Pasanen harri at mpaja.com
Wed Aug 22 09:53:48 CEST 2012


On 08/21/2012 01:27 AM, Alex Malyushytskyy wrote:
> For example one of our application on Windows ( this is the case when
> Windows is more flexible than Linux)
>
>   - reserves  the largest amount of continues memory we could afford
> for data (leaving enough for your widgets ) using VirtualAlloc with
> MEM_RESERVE flag,
> This insures that this address range will not be used when regular
> memory allocation occurs.
>
> - When data is loaded VirtualAlloc is called with MEM_COMMIT flag to
> allocate as much memory as needed.
> This approach works well since reservation takes no time, time
> consuming operation is (normally associated with memory allocations)
> committing.

I wonder why you say Linux is less flexible?   Couldn't you just write a 
custom allocator directly using sbrk()?

Also, 32 bit linux process leaves more application space free, so you 
can easily reach 2Gb process size, while I recall windows XP having 
issues after 1.5Gb.    It's been a while, so I might not recall all 
details...

Harri



More information about the Interest mailing list