Major performance problem in Heap32Next on Windows 7 - by James A Baker

Status : 

  External<br /><br />
		This item may be valid but belongs to an external system out of the direct control of this product team.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 524624 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/12/2010 5:46:45 PM
Access Restriction Public


Attn: Please route this bug to the Windows SDK team

Summary: The performance of Heap32Next function ( in Windows 7 is linear, rather than O(1), with respect to the total number of heap entries in all heap lists.

Graphs of the performance can be found at

Problem is exhibited on
Windows 7 Ultimate 32-bit and 64-bit

Problem is not exhibited on
Windows XP
Windows Server 2003
Windows Vista Ultimate
Windows Server 2008

Performance is the same when walking a small heap (15 entries) or large heap (2 million entries) - the only thing that counts is the total number of entries in all heaps.

One sampled stack during execution:
ntdll.dll!_RtlpWalkHeap@12()  + 0x3f bytes   
ntdll.dll!_RtlpQueryExtendedInformationHeap@16()  + 0x4f5 bytes   
ntdll.dll!_RtlpQueryExtendedInformationAllHeaps@12()  + 0xe5 bytes   
ntdll.dll!_RtlpQueryExtendedHeapInformation@12()  + 0xe7 bytes   
ntdll.dll!_RtlQueryHeapInformation@20()  + 0x1bc76 bytes   
ntdll.dll!_RtlQueryProcessHeapInformation@4()  + 0x288 bytes   
ntdll.dll!_RtlQueryProcessDebugInformation@12()  + 0x11492 bytes   
kernel32.dll!_Heap32Next@4()  + 0x4d bytes   
randwin.exe!RAND_poll()  Line 231 + 0x9 bytes    C++

This stack trace, with calls to functions like "QueryProcessDebugInformation" and "QueryExtendedInformationAllHeaps", makes me fear that some debugging code was somehow left in production?
Sign in to post a comment.
Posted by James A Baker on 1/15/2010 at 3:48 PM
Well, one day after pleading to not be ignored again, this ticket was closed. That frustrates me.
Posted by James A Baker on 1/14/2010 at 8:50 AM
Please don't blow me off. I was instructed to submit here by one C. Buchmiller, Senior Programming Writer in Windows Server UA, with guidance to "ask them to route the issue to the Windows SDK team. They will track down the dev owner and assign the bug to him/her."

You and I both know that the technet forums are a dead end. This issue has sat untouched in the Windows 7 forums for almost 2 months now at
Posted by Microsoft on 1/13/2010 at 10:58 PM
Thank you for your feedback, this connect site is for feedback on Visual Studio, .NET Framework and related technologies. For issues related to Windows, please use the following sites:

Windows Vista




Windows 7


Posted by Microsoft on 1/13/2010 at 3:35 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(