Memory allocation in D

Marius Muja mariusm at cs.ubc.ca
Fri Nov 30 19:59:16 PST 2007


> Weird.  D's GC is basically a "big bag of pages" allocator, where groups 
> of pages are divided into pools.  The maximum size a pool will be on its 
> own is 8 megs, with very large single allocations getting their own pool 
> that is as big as necessary.  If I had to guess, I'd say the 8MB you're 
> seeing is an artifact of this allocation scheme, and I'd suspect that 
> much of the 8MB is committed but marked as free pages in your program.

That seems to be the case. And because in my test program I was always 
allocating 4MB-sized arrays, the extra pages that were committed but 
marked as free couldn't be used.

Marius



More information about the Digitalmars-d mailing list