Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The first difference I noticed is that Windows Vista <strong>always</strong> uses the <em>Low Fragmentation Heap</em> (LFH). Windows XP does not seem to. <code>RtlFreeHeap</code> in Windows Vista is a lot shorter as a result -- all the work is delegated to <code>RtlpLowFragHeapFree</code>. <a href="http://msdn.microsoft.com/en-us/library/aa366750%28VS.85%29.aspx" rel="nofollow noreferrer">More information regarding LFH</a> and its presence in various OSs. Note the red warning at the top.</p> <h2><a href="http://msdn.microsoft.com/en-us/library/aa366703%28VS.85%29.aspx" rel="nofollow noreferrer">More information</a> (remarks section):</h2> <blockquote> <p>Windows XP, Windows Server 2003, and Windows 2000 with hotfix KB 816542: </p> <p>A look-aside list is a fast memory allocation mechanism that contains only fixed-sized blocks. Look-aside lists are enabled by default for heaps that support them. <strong>Starting with Windows Vista, look-aside lists are not used and the LFH is enabled by default</strong>.</p> </blockquote> <p>Another important piece of information: LFH and <code>NO_SERIALIZE</code> are mutually-exclusive (both cannot be active simultaneously). Combined with</p> <blockquote> <p>Starting with Windows Vista, <em>look-aside lists are not used</em></p> </blockquote> <p>This implies that setting <code>NO_SERIALIZE</code> in Windows Vista disables LFH, but it <em>does not</em> (and cannot) fall back to standard look-aside lists (as a fast replacement), according to the above quote. I'm unclear as to what heap allocation strategy Windows Vista uses when <code>NO_SERIALIZE</code> is specified. It looks like it's using something horribly naïve, based on its performance.</p> <h2>Even more information:</h2> <p>Looking at a few stack snapshots of <code>allocspeed.exe</code>, it seems to always be in a Ready state (not Running or Wait), and in TryEnterCriticalSection from HeapFree, and pegging the CPU at nearly 100% load for 40 seconds. (On Windows Vista.)</p> <p>Sample snapshot:</p> <pre><code>ntdll.dll!RtlInterlockedPushEntrySList+0xe8 ntdll.dll!RtlTryEnterCriticalSection+0x33b kernel32.dll!HeapFree+0x14 allocspeed.EXE+0x11ad allocspeed.EXE+0x1e15 kernel32.dll!BaseThreadInitThunk+0x12 ntdll.dll!LdrInitializeThunk+0x4d </code></pre> <p>Which is strange, because <code>NO_SERIALIZE</code> precisely tells it to <em>skip</em> lock acquisition. Something doesn't add up.</p> <p>This is a question only <a href="http://blogs.msdn.com/oldnewthing/" rel="nofollow noreferrer">Raymond Chen</a> or <a href="http://blogs.technet.com/markrussinovich/" rel="nofollow noreferrer">Mark Russinovich</a> could answer :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload