> AIUI, on Windows the smallest block you can ask for with VirtualAlloc > is 4 KiB. However, no more than one VirtualAlloc block can exist per > 64 KiB chunk. So if you ask for 4 KiB you'll end up wasting the > remaining 60 KiB of address space in the 64 KiB chunk.
Awesome memory, Nick. MSDN seems to confirm this. "The second parameter [to VirtualAlloc] indicates the range of addresses the function should allocate. This value can be anywhere from one page to 2 GB in size, but VirtualAlloc is actually constrained to a smaller range than that. The minimum size that can be reserved is 64K, and the maximum that can be reserved is the largest contiguous range of free addresses in the process. Requesting one page of reserved addresses results in a 64K address range." http://msdn.microsoft.com/en-us/library/ms810627.aspx We have the ability to intercept VirtualAlloc calls on Windows, so assuming that works for these particular VirtualAlloc calls (it should?) perhaps we can take backtraces and write them to a file. On Mon, Apr 8, 2013 at 7:57 PM, Nicholas Nethercote <n.netherc...@gmail.com> wrote: > On Mon, Apr 8, 2013 at 4:46 PM, Benjamin Smedberg <benja...@smedbergs.us> > wrote: >> >> 1) early in the memory info, there appears to be a common pattern of a >> committed block and then 15 free blocks. > > AIUI, on Windows the smallest block you can ask for with VirtualAlloc > is 4 KiB. However, no more than one VirtualAlloc block can exist per > 64 KiB chunk. So if you ask for 4 KiB you'll end up wasting the > remaining 60 KiB of address space in the 64 KiB chunk. > > Assuming I'm right about this (I'm fairly certain, but not 100%), it > sounds like some code (be it Mozilla or driver code) is > VirtualAlloc'ing lots of 4 KiB blocks, and thus wasting lots of > address space. > > Nick _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform