INFO: Address Space Layout of a Windows CE Process

This article was previously published under Q326162
This article has been archived. It is offered "as is" and will no longer be updated.
This article describes the 32-MB address space layout for a Microsoft Windows CE 3.0 process. It includes information about where DLLs are located and where the application (EXE) code is located. The article also describes the location of heaps and stacks.
More information
Windows CE is a 32-bit operating system. The address space of the whole system ranges from 0 to 4 GB, with the largest value for a 32-bit address. The address range from 2 GB to 4 GB is reserved for the system.
4 GBReserved for system
2 GBFile Mapped Memory
1 GB + 32 MB32 process slots
32 MBActive process, slot 0

The address space that ranges from 0 to 1 GB + 32 MB is additionally divided into 33 different sections. These sections are named "process slots," with slot 0 at the bottom and slot 32 at the top. Slot 0 is used for the active process.

Each process on Windows CE maintains 32 MB of address space for DLLs, stacks, heaps, and other allocations. The 32-MB area that starts with address 0x02000000 is reserved for ROM-based DLLs that are designated as execute in place (XIP) functionality.
  • DLLs that load from RAM by the process follow the ROM-based DLLs.
  • Any free address space that is available to the process follows next.
  • The heap or heaps are present in the address space.
  • The stack or stacks are next
  • The sections for the EXE module reside lowest in the process address space. These addresses start at 64 kilobytes (KB) with address 0x00010000.
  • The system reserves the address range from 0 to 64 KB.

The order where heaps and stacks appear as described earlier is generally for simple applications. In a more complex application that has run for a while, the heaps and the stacks can appear in various orders and anywhere in the 32-MB address space that is free address space. This includes the region where ROM DLLs are designated.

When the heap manager must increase the size of the heap, it calls the VirtualAlloc function with the IpAddress parameter of NULL. For an application that uses a lot of memory and address space, Windows CE increases the size of the heap anywhere it can find free address space. That includes the region where the ROM DLLs are designated.

When an application creates a thread, Windows CE allocates a stack for the thread that uses VirtualAlloc. Again, Windows CE allocates the stack anywhere it can find free address space for the process that owns the thread.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
259932 INFO: Process Space Usage by ROM-Based DLLs

Article ID: 326162 - Last Review: 10/26/2013 10:31:00 - Revision: 4.0

Microsoft Windows CE 3.0 for the Handheld PC

  • kbnosurvey kbarchive kbinfo KB326162