4

We have Windows Server 2022 physical terminal servers, where users log in and run applications, including finite elements computations. Depending on what the users do, applications can consume all processor and RAM, and Windows becomes unstable.

The System log contains errors like:

Application popup: dwm.exe - System Error : The process has terminated because it could not allocate additional memory.

And low-memory warnings:

Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: fl_mpi2320.exe (7256) consumed 8,306,704,384 bytes, fl_mpi2320.exe (6020) consumed 6,652,760,064 bytes, and fl_mpi2320.exe (11188) consumed 6,635,606,016 bytes.

This is problematic because system processes crash. Remote desktop connections don't work any more, and we need to remotely restart the hosts to recover.

I searched for solutions, but did not find a way to ensure that user processes can't affect the system in this way (no system settings nor GPOs). Increasing the page file could make the problem appear a bit later, but wont solve it.

Adding RAM is not an option. The memory is enough for what users need to do, with minor exceptions, and there will be always someone who will try to compute something too big to fit in memory. User education would be the best solution, but it doesn't work well enough, as many people are just wanting to see their results as quickly as possible.

It's possible to write a Windows service that kills the user processes when they use too much memory, but it might be too late for the system. Remotely killing them doesn't resurrect the machines when the memory is depleted.

How can I prevent the system from allocating too much memory?

Greg Askew
  • 39,132
Ale
  • 1,833

2 Answers2

4

I don't believe Windows natively has this as a feature (anymore - there was a feature called Resource Manager, looks like it was deprecated after 2012).

You could look at deploying virtualization hosts for remoteapp, rather than allowing the host OS to be where the applications are run. That would at least limit the failure domain to (probably) just the impacted user.

I know that Citrix Virtual Apps lets you get very granular with resource limit policies; it has (and apparently still does) fill in a number of gaps in the native OS app delivery space.

You could also check in with your FEM software vendor and see if the app itself has any way to set a ceiling on how much memory it will try to use.

mfinni
  • 36,892
3

This is a use case where Remote Desktop is not a good fit. A virtual desktop would be a better solution in this case. Remote Desktop is for predictable, deterministic usage of traditional applications. Anyone can copy and paste a PowerShell script that consumes all memory in 10 seconds or uses all processors by pressing F9 in Excel in a worksheet that takes 45 minutes to recalculate.

Greg Askew
  • 39,132