Possible to set a maximum of memory consumption on a powershell script in % or megabyte? -


I sometimes have scripts that are consuming all the storage since I do not want to monitor them all the time or the CPU I set the priority to at least manually, so I'm thinking that one option to give that specific script is probably (MB) of memory Is this option present?

PowerShell does not provide any inherent way to control system resources to be used by the script Wide Memory

The Windows process provides a way to limit system resources to groups of resources, you can learn more about it:

If your scripts are taking too much memory, I wanted to suggest a check for memory leak, there are several tools that help in tracking the leaks in memory. There are fewer levels (like use! Dumps from SOS to Windbag) Others are very smart, you take many snapshots and you can show new allocated objects between snapshots. You can search for "Net Memory Profiler" to get an idea of ​​what's available.


Comments