Windows Tools

Pageheap.exe: Page Heap

Overview | Notes | Syntax | Examples | Related Tools

This command line tool sets page heap flags that help to find heap-related bugs and corruption. It can also help detect leaks in applications that are running on Windows 2000 Professional SP2 and Windows XP Professional systems.

PageHeap introduces a software validation layer (Page Heap manager) between the application and the system that verifies all dynamic memory operations (allocations, frees, and other heap operations). When Page Heap manager is enabled, the application being tested is then launched under a debugger. If a bug is encountered, it will cause a debugger break.

Important

Corresponding UI

There is no corresponding user interface for PageHeap.

Concepts

A common problem in application development is heap corruption. This typically occurs when an application allocates a block of heap memory of a given size and then writes to memory addresses beyond the requested size of the heap block. Heap corruption can also occur when an application writes to block of memory that has already been freed.

Two concepts are central to understanding the commands related to PageHeap and the way to use it:

Full-page heap reveals corruptions in heap blocks by placing a non-accessible page at the end of the allocation. The advantage of this approach is that you achieve "sudden death," meaning that the process will access violate (AV) exactly at the point of failure. This behavior makes failures easy to debug. The disadvantage is that every allocation uses at least one page of committed memory. For a memory-intensive process, system resources can be quickly exhausted.

Normal page heap can be used in situations where memory limitations render full-page heap unusable. It checks fill patterns when a heap block is freed. The advantage of this method is that it drastically reduces memory consumption. The disadvantage is that corruptions will only be detected when the block is freed. This makes failures harder to debug.

System Requirements

The following are the system requirements for PageHeap:

File Required