尝试使用所有可用 RAM 时,程序终止前仅使用 2 GB

When attempting to use all available RAM, only 2 GB are used before the program terminates

当我执行以下代码时,任务管理器中的 RAM 使用率增加得非常快。但是,在大约不到 2 GB 时,它的速度严重下降,然后我收到错误 "This application has requested the Runtime to terminate it in an unusual way."

while(true){
   int *pointer66 = new int;
}

2 GB 标记处发生了什么? Windows 正在节流吗?

我一开始以为它可能是防病毒软件,所以我禁用了它,但它没有任何作用。

根据您最后的评论,该程序可能由于未处理的 C++ 异常而失败。 Windows 不完全理解失败的原因,所以它只是报告异常退出。