Forum Discussion
Firmbyte
Mar 07, 2022Copper Contributor
Huge memory consumption using ForEach-Object -Parallel
I’ve a function that updates the stats in databases using ForEach-Object -Parallel. When I run it, to loop through the stats in a database and update them, it consumes a lot of memory on the server w...
Mar 09, 2022
I tested this yesterday, 1.6Gb for PowerShell after setting a variable for processing some things, if I set the variable to $null the memory usage stayed 1.6Gb and after running [system.gc]::Collect() is was 300Mb. Should work for you and keep the memory usage down while processing scripts, let us know!