计算机组成原理实验 ram_如果我的计算机有很多RAM,应该禁用页面文件吗?

计算机组成原理实验 ram

计算机组成原理实验 ram

should-i-disable-the-page-file-if-my-computer-has a-lot-of-ram-00

If you have a computer with a hefty amount of RAM, would you gain any benefits from disabling the page file or should you just leave well enough alone? Today’s SuperUser Q&A discusses the topic to help satisfy a reader’s curiosity.

如果您有一台拥有大量RAM的计算机,那么从禁用页面文件中是否可以获得任何好处,还是应该让自己呆得足够好? 今天的超级用户问答讨论了该主题,以帮助满足读者的好奇心。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Photo courtesy of Collin Anderson (Flickr).

图片由Collin Anderson(Flickr)提供

问题 (The Question)

SuperUser reader user1306322 wants to know if there are any benefits to disabling the page file if a person’s computer has a lot of RAM:

超级用户阅读器user1306322想知道如果人的计算机具有大量RAM,则禁用页面文件是否有任何好处:

Imagine that I have tons of RAM, say 64 GB, for example. That is a lot, even for gaming computers. Now the default location of a page file in Windows is on the main operating system drive (be it HDD or SSD), which is faster in general but still not as fast as RAM.

想象一下,我有大量的RAM,例如64 GB。 即使对于游戏计算机,这也很多。 现在,Windows中页面文件的默认位置位于主操作系统驱动器上(无论是HDD还是SSD),该速度通常较快,但仍不如RAM快。

Something tells me that disabling the page file on the hard-drive or creating a virtual RAM drive and letting the page file be there could make Windows move all its virtual memory to RAM and increase the system’s performance. But I am not very knowledgeable in that area, so that might not be true at all.

某件事告诉我,禁用硬盘驱动器上的页面文件或创建虚拟RAM驱动器并将页面文件保留在其中可能会使Windows将其所有虚拟内存移至RAM并提高系统性能。 但是我在这方面知识不是很丰富,所以可能根本就不是这样。

I tried both, but I could not analyze the results to reach a definite conclusion with my knowledge level in memory-related matters. Would this work? If not, then why?

我都尝试过,但是我无法用我在记忆相关问题上的知识水平来分析结果,从而无法得出肯定的结论。 这行得通吗? 如果没有,那为什么呢?

Would user1306322 gain any benefits from disabling the page file?

user1306322可以从禁用页面文件中获得任何好处吗?

答案 (The Answer)

SuperUser contributor David Schwartz has the answer for us:

超级用户贡献者David Schwartz为我们提供了答案:

No matter how much RAM you have, you want the system to be able to use it efficiently. Not having a page file at all forces the operating system to use RAM inefficiently for two reasons:

无论您有多少RAM,都希望系统能够有效地使用它。 根本没有页面文件会导致操作系统无法充分利用RAM,这有两个原因:

  • First, it cannot make pages discardable, even if they have not been accessed or modified in a very long time, which forces the disk cache to be smaller.

    首先,即使很长时间没有访问或修改页面,也无法使页面可丢弃,这将迫使磁盘缓存变小。
  • Second, it has to reserve physical RAM to back allocations that are very unlikely to ever require it (for example, a private, modifiable file mapping), leading to a case where you can have plenty of free physical RAM and yet allocations are refused to avoid over-committing.

    其次,它必须保留物理RAM来支持极不可能需要的分配(例如,私有的,可修改的文件映射),导致您可以拥有大量可用的物理RAM,但是却拒绝分配避免过度投入。

Consider, for example, if a program makes a writable, private memory mapping of a 4 GB file. The operating system has to reserve 4 GB of RAM for this mapping because the program could conceivably modify every byte and there is no place but RAM to store it. So from the start, 4 GB of RAM is basically wasted (it can be used to cache clean disk pages, but that is about it).

例如,请考虑程序是否对4 GB文件进行可写的私有内存映射。 操作系统必须为此映射保留4 GB的RAM,因为该程序可以想像地修改每个字节,并且除了RAM之外没有其他地方可以存储它。 因此,从一开始,基本上就浪费了4 GB的RAM(它可用于缓存干净的磁盘页面,但仅此而已)。

You need to have a page file if you want to get the most out of your RAM, even if it is never used. It acts as an insurance policy that allows the operating system to actually use the RAM it has, rather than having to reserve it for possibilities that are extraordinarily unlikely.

如果要最大程度地利用RAM,即使从未使用过,也需要一个页面文件。 它充当一种保险单,使操作系统可以实际使用其拥有的RAM,而不必将其保留给极不可能的可能性。

The people who designed your operating system’s behavior are not fools. Having a page file gives the operating system more choices, and it will not make bad ones.

设计操作系统行为的人并不是傻子。 具有页面文件为操作系统提供了更多选择,并且不会做出不好的选择。

There is no point in trying to put a page file in RAM. And if you have lots of RAM, the page file is very unlikely to be used (it just needs to be there), so it does not particularly matter how fast the device it is on is.

试图将页面文件放入RAM没有任何意义。 而且,如果您有大量RAM,则极不可能使用该页面文件(只需将其保存在该文件中),因此它与设备的运行速度无关紧要。

Make sure to check out the lively discussion thread about the topic via the link below!

请确保通过下面的链接查看有关该主题的生动讨论线程!



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/199990/should-i-disable-the-page-file-if-my-computer-has-a-lot-of-ram/

计算机组成原理实验 ram

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值