问题描述
我正在尝试重现似乎在用户用完一堆RAM时出现的错误.限制计算机可以使用的可用RAM或填满其中的最佳方法是什么?我更愿意这样做,而不需要物理上删除内存,也不需要运行一堆任意的,占用大量内存的程序(例如,Photoshop,Quake等).
I'm trying to reproduce a bug that seems to appear when a user is using up a bunch of RAM. What's the best way to either limit the available RAM the computer can use, or fill most of it up? I'd prefer to do this without physically removing memory and without running a bunch of arbitrary, memory-intensive programs (ie, Photoshop, Quake, etc).
推荐答案
使用虚拟机并在虚拟机上设置资源限制以模拟所需的条件.
Use a virtual machine and set resource limits on it to emulate the conditions that you want.
VMWare是该领域的领导者之一,他们有一个免费的vmware播放器,让您做到这一点.
VMWare is one of the leaders in this area and they have a free vmware player that lets you do this.
这篇关于如何限制RAM以测试内存不足的情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!