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

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

问题描述

我正在开发一个 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.

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

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