Change the memory limit for each application in Windows 10 Universal Applications

In our tests, it seems that memUsageLimit is fixed in the function of the installed RAM and platform. For smartphones (mainly ARM processors) restrictions

185 MB for 512 MB RAM device
390 MB for 1GB RAM device
900 MB for 2GB RAM device

For regular Windows + Intel platforms, we found that the limit is 20% more than the physical RAM available, possibly due to the ability to pager to disk.

My question is about the first group of devices (phones): is it possible to change the memory limit for this application? We need to process the JSON document received through oData V4, and when processing with NewtonSoft, memory consumption is very important: for each MB of pure JSON data, the application process increases by about 9 MB in a very linear mode.

+4
source share
1 answer

Win10 1.586 provides the new TrySetAppMemoryUsageLimit API to set an application memory limit. However, based on internal discussion, this API only works for a very limited scenario right now, such as a VOIP application on a mobile device. And the sample code and document for this API is not quite ready yet.

I tested this API on a UWP VOIP image and it works (we need to set the sample target to 10586). The code is as follows:

var y = MemoryManager.AppMemoryUsageLimit;
bool result = MemoryManager.TrySetAppMemoryUsageLimit(y+10000);

, . - , . , : win store . APP .

+6

Source: https://habr.com/ru/post/1617230/


All Articles