Microsoft KB Archive/267802

= Page heap enhancements included with Windows 2000 Service Pack 1 =

Article ID: 267802

Article Last Modified on 2/28/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q267802





SUMMARY
This article describes the additional page heap features in Windows 2000 Service Pack 1 that you can use for advanced debugging.



MORE INFORMATION
Windows 2000 Service Pack 1 includes the following types of page heap.

Normal Page Heap
This functionality remains the same; an allocation is examined when it is freed. You can enable normal page heap by using the regular syntax. For example, type pageheap /enable at a command prompt.

Full Page Heap
This functionality catches problems sooner by placing inaccessible pages at the end of an allocation. However, this method uses a lot of memory because every allocation uses at least one page of memory. You can enable full page heap by using the /full switch. For example, type pageheap /enable  /full at a command prompt.

You can enable full page heap on a per-DLL basis; this is helpful in further isolating an overwrite when full page heap is required. Full page heap uses too many resources when you use it on the whole process. For example, the following command causes the listed DLLs to have full page heap, while the rest of the process (including Iexplore.exe and the remaining DLLs) get normal page heap:

pageheap /enable iexplore.exe /dlls ole32.dll mshtml.dll jscript.dll

The following page heap switches have also been added:  /Size: Specifies the amount of memory to be used by page heap. The command syntax is:

pageheap /enable  /full /size

is the name of the image, and  and   are the closed size interval in bytes (decimal) for blocks to be allocated in page heap.

 /Address: Specifies the address range for page heap allocations. The command syntax is:

pageheap /enable  /full /address

is the name of the image, and  and   is the address range to be searched on all allocation stack traces in C-style hexadecimal notation, such as 0xabcdef00.

 /Random: Specifies the random page heap allocations. The command syntax is:

pageheap /enable  /full /random

is the name of the image, and  is a decimal number between 0 and 100 that represents the probability used to determine whether the allocation is going to be made in full page heap. A value of 100 is the equivalent of the /full switch, and a value of 0 is normal page heap.

 /Backwards: Used to detect a backward overrun, which places a non-accessible page at the beginning of an allocation, as opposed to the end. The command syntax is:

pageheap /enable /full /backwards

 /Unaligned: Used for unaligned allocations, and prevents the usage of a &quot;fill pattern&quot; to align allocations to pages. Many programs, such as Microsoft Internet Explorer, make certain assumptions about the alignment and do not work with this switch. The command syntax is:

pageheap /enable  /full /unaligned

is the name of the image.

 /Decommit: Specifies uncommitted pages for full page heap allocations. This switch has the same effect as the /full switch by itself, but it uses less memory. Instead of using a whole page for the beginning and end of an allocation, it simply reserves virtual space. The access violation is the same, and this method can replace the current /full page heap switch. The command syntax is:

pageheap /enable  /full /decommit

is the name of the image.</li></ul>

Keywords: kbenv kbinfo KB267802

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.