如何在 Windows 中使用大页面运行我的应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:08:16  来源:igfitidea点击:

How do I run my app with large pages in Windows?

windowswindows-server-2003

提问by staffan

Large pages are available in Windows Server 2003and Windows Vista.

大页面在Windows Server 2003和中可用Windows Vista

But how do I enable large pages for my application?

但是如何为我的应用程序启用大页面?

回答by staffan

Martin's answer is correct on Windows Server 2003:

Martin 在 Windows Server 2003 上的回答是正确的:

You will have to assign the "Lock pages in memory" privilege to any user that runs your > application. This includes administrators

  1. Select Control Panel -> Administrative Tools -> Local Security Policy
  2. Select Local Policies -> User Rights Assignment
  3. Double click "Lock pages in memory", add users and/or groups
  4. Reboot the machine

您必须将“在内存中锁定页面”权限分配给运行您的 > 应用程序的任何用户。这包括管理员

  1. 选择控制面板 -> 管理工具 -> 本地安全策略
  2. 选择本地策略 -> 用户权限分配
  3. 双击“在内存中锁定页面”,添加用户和/或组
  4. 重启机器

On Windows Vista you need also make sure that the application is run as Administrator (by right-clicking on the application or the shell and choosing "Run as adminstrator".

在 Windows Vista 上,您还需要确保应用程序以管理员身份运行(通过右键单击应用程序或外壳并选择“以管理员身份运行”。

In addition, it helps to have a freshly booted machine since the large pages can "run out" due to fragmentation of the heap.

此外,它有助于拥有一台新启动的机器,因为大页面可能会由于堆的碎片而“耗尽”。

回答by Martin

You will have to assign the Lock pages in memoryprivilege to any user that runs your application. This includes administrators.

您必须将Lock pages in memory权限分配给运行您的应用程序的任何用户。这包括管理员。

  1. Select Control Panel -> Administrative Tools -> Local SecurityPolicy
  2. Select Local Policies -> User Rights Assignment
  3. Double click "Lock pages in memory", add users and/or groups
  4. Reboot the machine
  1. 选择控制面板 -> 管理工具 -> 本地安全策略
  2. 选择本地策略 -> 用户权限分配
  3. 双击“在内存中锁定页面”,添加用户和/或组
  4. 重启机器