多少内存可以x64时

多少内存可以x64时

本文介绍了多少内存可以x64时,过程可能要花上4GB内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个64位的应用程序。这是一个有点沉重的应用程序(在线程数量,所需的内存等方面)。我跑了4GB内存的64位Windows7的四核机器上这个应用程序。但我注意到的是我的应用程序大约需要2.2-2.3 GB拉姆后崩溃。这是必需的品行?可在64位应用程序的最大的4GB内存只需要2.3-2.4 GB的RAM?

I have a x64 application. It is a bit heavy application (in terms of thread counts, memory needed etc). I'm running this application on a 4GB RAM 64-bit Windows7 Quad core machine. But what i notice is after my application takes around 2.2-2.3 GB Ram it crashes. Is this required behavious? Can 64bit applications at max take only 2.3-2.4 GB RAM from 4GB RAM?

推荐答案

内存量是不关心的,一个进程分配的虚拟的内存。虚拟存储器的可以在64位分配过程的量仅受限于操作系统的提供的网页来映射虚拟存储器到RAM中的能力。这通常是只有最大允许分页文件的限制,假设你没有创建自己的映射用的CreateFileMapping()。这是系统设置,控制面板+系统+高级。有一个上限的Windows版本,以及强加的,16千兆字节的Windows 7家庭premium,192千兆字节的专业及以上。

The amount of RAM is of no concern, a process allocates virtual memory. The amount of virtual memory you can allocate in a 64-bit process is only limited by the operating system's ability to provide pages to map the virtual memory to RAM. Which is normally only limited by the largest allowed paging file, assuming you didn't create your own mapping with CreateFileMapping(). It is a system setting, Control Panel + System + Advanced. There's an upper limit as well imposed by the Windows edition, 16 gigabytes for Windows 7 Home Premium, 192 gigabytes for Professional and up.

当你的程序实际上访问的虚拟内存RAM时使用。产生当存储器未映射又一个页面错误。 64位过程通常减慢到爬行,由于这些页面错误如果您分配和使用内存大大超出了RAM的数量,你消耗所有可用的页面以及之前。

RAM is only used when your program actually accesses the virtual memory. Which generates a page fault when the memory isn't mapped yet. A 64-bit process typically slows down to a crawl due to these page faults if you allocate and use memory considerably beyond the amount of RAM, well before you consume all available pages.

既然你是相当南方典型的最大页面文件的大小,这肯定只是一个普通的老堆损坏问题。

Since you are considerably South of the typical maximum paging file size, this is surely just another plain old heap corruption bug.

这篇关于多少内存可以x64时,过程可能要花上4GB内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 05:27