我试图理解为什么当我导入一个大约 16MB 的文件作为变量时 PowerShell 的内存膨胀这么多。我可以理解围绕该变量存在额外的内存结构,但我只是想了解它为什么那么高。这是我在下面所做的 - 只是任何人都可以运行的另一个脚本的精简片段。
笔记/问题
我的测试代码
Invoke-WebRequest -uri "http://s3.amazonaws.com/alexa-static/top-1m.csv.zip" -OutFile C:\top-1m.csv.zip
Expand-Archive -Path C:\top-1m.csv.zip -DestinationPath C:\top-1m.csv
$alexaTopMillion = Import-Csv -Path C:\top-1m.csv
Run Code Online (Sandbox Code Playgroud)
对任何回答这个问题的人:感谢您的时间并帮助我每天学习更多!
memory powershell memory-profiling pscustomobject import-csv