I have very large JSON files that I would like to explore the structure of before processing. Some of these can be in excess of 4-5 GB, but the one I've picked a smaller one just for exploration purposes. The bonus difficulty here is that the files were minified, so this data is on a single line.
I am attempting to do this with Get-Content in PowerShell 7 (x64), but am getting this error:
Get-Content: Exception of type 'System.OutOfMemoryException' was thrown.
My MaxMemoryPerShellMB is set to the Windows 11 default of 2147483647. If I monitor Task Manager while this is running, the pwsh process hits 3,599 GB then throws the exception. For fun, I also lowered the MaxMemoryPerShellMB to 8096 to put it within the boundaries of my machine (32 GB), but that obviously had no effect.
Any thoughts on why 64-bit PowerShell is throwing a max memory exception at the 32-bit limit? And is there a better method for loading this much data with PowerShell or is it just impossible?
The exact size of this file is 1,832,252,369 bytes.