是真的32Bit程序会内存不足,如果其他程序使用太多,在64位Windows? [英] Is it true that 32Bit program will be out of memory, if other programs use too much, in 64bit windows?

查看:427
本文介绍了是真的32Bit程序会内存不足,如果其他程序使用太多,在64位Windows?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个32位应用程序,并出现内存错误。

I am developing a 32 bit application and got out of memory error.

我注意到我的Visual Studio和一个插件(其他应用程序)使用了太多的内存,大约4或5 GB。

And I noticed that my Visual Studio and a plugin (other apps too) used too much memory which is around 4 or 5 GB.

所以我怀疑这些程序占用了所有内存地址,我的程序能够找到空闲内存。

So I suspected that these program use up all the memory addresses where my program is able to find free memory.

我想32位只能使用前4 GB,其他内存不能使用。

I suppose that 32 bit can only use the first 4 GB, other memory it can not use at all.

我不知道这是否正确,另一方面,我会寻找其他答案,例如我的错误代码。

I don't know if I am correct with this, other wise I will look for other answers, like I have bug in my code.

推荐答案

您的


我想32位只能使用第一个4吉字节,其他手段
它根本不能使用。

I suppose that 32bit can only use the first 4 giga byte, othere momery it can not use at all.

绝对不正确。在64位操作系统中,由于虚拟到物理内存的转换表为64位,所以所有应用程序都可以使用所有内存,而不管它是多少位。

is definitely incorrect. In a 64-bit OS, all applications can use all of the memory, regardless of what bitness it is, thanks to the translation table for virtual to physical memory being 64-bit.

一些真正古老的硬件可能不允许DMA地址超过4GB,但我真的希望大部分是在垃圾场现在。

Some really ancient hardware may not allow DMA to addresses above 4GB, but I really hope most of that is in the junk-yard by now.

如果系统作为一个整体运行内存不足,它会或多或少地影响所有应用程序。

If the system as a whole is running low on memory, it will affect all applications more or less equally.

但是,32位应用程序默认只能使用虚拟地址范围的低2GB(虽然这些2GB可以放置在物理内存中的任何地方,如上所述借助于64位转换表)。你可以通过在链接命令中使用 / LARGEADDRESSAWARE 将它扩展到接近4GB(在32位操作系统中为3GB,并且符合/ 3GB引导标志)这简单地告诉操作系统你的应用程序将理解地址可以是负的,因此将正确地操作地址超过2GB。

However, a 32-bit application can only, by default, use the lower 2GB of the virtual address range (although these 2GB can be placed anywhere in the physical memory, as described above by means of a 64-bit translation table). You can extend this to nearly 4GB (3GB in a 32-bit OS, and subject to the /3GB boot flag in this case) by using /LARGEADDRESSAWARE in your linking command - this simply tells the OS that your application will "understand" that addresses can be negative, and thus will operate correctly with addresses over 2GB.

这篇关于是真的32Bit程序会内存不足,如果其他程序使用太多,在64位Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆