Forum Discussion
Maureen77
Jun 15, 2022Copper Contributor
array limitations?
Are there limitations to array sizes? I'm trying to get the line count of very large .txt files ( so far the largest file is 782MB) and also look for duplicates. The script works with small files a...
LainRobertson
Jun 15, 2022Silver Contributor
There's no real "limitations" as such to the classes themselves.
From a resources perspective, I'd be wary of looking at CPU overall as, for example, a four core machine with one core running at 100% utilisation (likely indicating a problem) will report overall utilisation of 25%.
Given many processes do not run as parallel workloads over multiple cores, this is something to be mindful of.
Windows PowerShell memory limits are reasonably low per shell. You can read more about how to change this (whether it should be changed is a separate consideration) here.
Learn How to Configure PowerShell Memory - Scripting Blog (microsoft.com)
You'd want to be confident you've optimised the script before increasing the per shell limit or else you'll just run into the same issue again at the higher level.
Cheers,
Lain