Powershell 報 System.OutOfMemoryException 錯
-
問題描述:
- 一打開vscode 內(nèi)存和CPU占用率就飆升
- powershell 打開就報 System.OutOfMemoryException ,且卡死,無法執(zhí)行任何命令
-
問題原因:
- 每次在 powershell 執(zhí)行命令,都會被記錄下來,存到一個文件。且每次啟動 powershell 的時候都會讀取這個文件
- 當這個文件足夠大的時候(我出現(xiàn)這個問題的時候,這個文件已經(jīng)達到 2G了)。啟動 powershell 就會卡死
-
解決方法:
- 找到這個文件,并將其內(nèi)容清空
-
文件路徑為:~\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt。截圖如下“
未命名.PNG