delphi - 如何使我的 32 位 Delphi 应用程序能够在 64 位 Windows 上使用 4GB 内存(通过 Wow64.exe)?

标签 delphi 64-bit 32-bit

根据这个MSDN page :

WOW64 enables 32-bit applications to take advantage of the 64-bit kernel. Therefore, 32-bit applications can use a larger number of kernel handles and window handles. However, 32-bit applications may not be able to create as many threads under WOW64 as they can when running natively on x86-based systems because WOW64 allocates an additional 64-bit stack (usually 512 KB) for each thread. In addition, some amount of address space is reserved for WOW64 itself and the data structures it uses. The amount reserved depends on the processor; more is reserved on the Intel Itanium than on the x64 processor.

If the application has the IMAGE_FILE_LARGE_ADDRESS_AWARE flag set in the image header, each 32-bit application receives 4 GB of virtual address space in the WOW64 environment. If the IMAGE_FILE_LARGE_ADDRESS_AWARE flag is not set, each 32-bit application receives 2 GB of virtual address space in the WOW64 environment.

如何在 Delphi 2007 应用程序中有效地设置 IMAGE_FILE_LARGE_ADDRESS_AWARE 标志,以便使我的 32 位应用程序 Wow64感知 并寻址到完整的 4GB 内存?

最佳答案

请参阅这篇 CodeCentral 文章:Using more than 3 GB memory in a 32 bit Delphi program .

在现代 Delphi 版本中,只需将编译器指令添加到 dpr: {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}

关于delphi - 如何使我的 32 位 Delphi 应用程序能够在 64 位 Windows 上使用 4GB 内存(通过 Wow64.exe)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1849344/

相关文章:

windows - 如何检查一个进程中可以使用的地址空间的最大内存量

linux - gcc:在 32 位平台上编译 64 位二进制文​​件

delphi - 从零开始的字符串

c - 警告 : left shift count >= width of type

gcc - 在 Ubuntu 64 位上使用 gcc 4.5.2 编译 SUNDANCE 4.73

c# - '<Module>' 的类型初始值设定项抛出异常并且算术运算导致溢出

linux - Linux 堆栈的 ASLR 熵位

delphi - 泛型无法正确解析方法类型

sql - 哪种语言最先引入“in”关键字:SQL或对象Pascal?

delphi - 是否有一个 Delphi 库可以返回项目的所有有效源路径?