通过强制程序使用页面文件来节省 RAM
我正在运行游戏服务器,当它们没有玩家运行时,我想将服务器的内存放入页面文件中以节省 RAM。
我确实知道 Windows 将最近未访问的内存放入页面文件中,但是这些游戏服务器与 0 名玩家一起完成的工作并不具有很高的紧迫性。
至于游戏服务器即使有 0 个玩家也需要完成的工作,我愿意自己测试一下,看看在页面文件中运行它是否会导致问题,所以我不需要被告知它是否是一个坏主意,除非它绝对不合理。
I was running game servers and when they have no players running, I wanted to put the servers' memory into the page file to save RAM.
I do know that Windows puts memory that wasn't accessed recently into the page file, however the jobs done with 0 players by these game servers do not have high urgency.
As far as jobs that the game servers need to do even with 0 players, I'm willing to test that myself and see if running it in the page file will cause a problem, so I don't need to be told if it's a bad idea unless it absolutely won't be reasonable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
操作系统在管理其页面文件方面会比您做得更好,如果您的进程处于空闲状态并且物理内存正在使用中,那么它已经被换出。通常不需要手动控制此过程。
但是,如果您的进程将要休眠,并且您想告诉 Windows 尽快将进程的内存冻结,您可以使用 SetProcessWorkingSetSize。
The operating system will do a far better job than you can at managing its page file, and if your process is idle and the physical memory is in use, it will already be paged out. There isn't normally any need to control this process manually.
However, if your process is going to sleep and you want to tell Windows to put your process's memory on ice as soon as possible, you can adjust its working set size using SetProcessWorkingSetSize.