I know the default page size of a 32-bit process running on 32-bit Windows is 4K, whereas that of a 64-bit process running on 64-bit Windows is 8K. However, what is the actual page size of a 32-bit process running on 64-bit Windows (i.e. WOW64) ? 4K? 8K?
3 Answers
Ideally, you should call GetSystemInfo() and examine SYSTEM_INFO.dwPageSize.
Btw, I doubt that you have 8KB pages in 64-bit Windows. x86/64 CPUs support pages of the following sizes: 4KB (all modes), 4MB (32-bit non-PAE), 2MB (32/64-bit PAE), 1GB (64-bit, always PAE). You can find this in the CPU manual from Intel (or AMD).
Comments
The page size is still 4K - 1M pages at 4GB maximum addressable RAM memory
Virtual memory size. On the Intel Itanium processor, WOW64 adds significant overhead if two or more instances of the same 32-bit application are running concurrently. This is due to the native 8 KB pages on the Intel Itanium, which complicates the emulation of the native 4 KB pages on the x86 architecture (more pages are marked as writable; all writable pages are private to the process). This can adversely affect the scalability of Terminal Services on certain processors. This is not the case for the x64 processor.
4 Comments
The correct answer to this question is "It depends on which processor".
Itanium uses 8KB pages.
X86-32 and x86-64 uses 4KB, 2MB and 1GB pages as appropriate [note that for 2MB and 1GB pages to work, the memory needs to be a multiple of 2MB/1GB in size and be aligned to 2MB/1GB respectively].
Other processors, such as ARM (currently only 32-bit OS), typically uses 4KB pages, but can also use 64KB pages.
If you can find an old DEC Alpha processor, and operating system to match, that would also use 8KB pages.