Efficiency: what block size of kernel-mode memory allocations?

Posted by Robert on Stack Overflow See other posts from Stack Overflow or by Robert
Published on 2010-05-28T08:29:14Z Indexed on 2010/05/28 8:31 UTC
Read the original article Hit count: 179

Filed under:
|
|
|
|

I need a big, driver-internal memory buffer with several tens of megabytes (non-paged, since accessed at dispatcher level).
Since I think that allocating chunks of non-continuous memory will more likely succeed than allocating one single continuous memory block (especially when memory becomes fragmented) I want to implement that memory buffer as a linked list of memory blocks.

What size should the blocks have to efficiently load the memory pages?
(read: not to waste any page space)

  • A multiple of 4096? (equally to the page size of the OS)
  • A multiple of 4000? (not to waste another page for OS-internal memory allocation information)
  • Another size?

Target platform is Windows NT >= 5.1 (XP and above)
Target architectures are x86 and amd64 (not Itanium)

© Stack Overflow or respective owner

Related posts about memory

Related posts about size