简体   繁体   English

有什么方法可以限制物理内存的使用? (页面文件可以)

[英]Any way to limit physical memory usage? (Page file is OK)

I'm writing a program that requires more memory than my system has. 我正在编写一个程序,该程序比我的系统需要更多的内存。

Is there any way for me to artificially put a limit to its physical memory usage? 我有什么办法可以人为地限制其物理内存使用量?
ie Once it goes past the limit, the program should start paging to/from disk -- whether or not the physical memory is actually available. 即,一旦超过限制,程序应开始到磁盘或从磁盘分页-物理内存是否实际可用。 (That way the other programs I'm running can still run from memory and won't need to access the pagefile as often.) (这样,我正在运行的其他程序仍然可以从内存中运行,并且不需要经常访问页面文件。)

没关系,我只是找到了答案: SetProcessWorkingSetSizeEx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM