Windows 10 的应用程序内存限制是多少?

What are the app memory limits for Windows 10?

Windows Phone 8.1 的应用程序内存限制很容易在 MSDN 上找到。但我似乎找不到有关 Windows 10 上应用程序内存限制的确切信息,尤其是 Windows 10 Mobile。

每个设备系列(Xbox、台式机、phone、IoT)的限制是什么?

我发现它们可用如下:

  1. Windows.System.MemoryManager.AppMemoryUsage = 当前内存使用 (无符号长)
  2. Windows.System.MemoryManager.AppMemoryUsageLevel = 0、1、2 等
  3. Windows.System.MemoryManager.AppMemoryUsageLimit = 512 MB 模型似乎固定为 185 MB,对于 1GB 模型是 390 MB,等等 on (unsigned long)

在我们的测试中,当 AppMemoryUsage 接近 AppMemoryUsageLimit 并且无法在连续的空闲内存空间中分配新对象时,会引发 OutOfMemoryException。似乎 AppMemoryUsageLimit 无法更改,并且是固定数量,具体取决于安装的 RAM,但目前还不确定。