Is My Command Causing Memory Issues on My PC?
Asked by
polenta please
I've been experiencing some memory problems with my PC, and I'm starting to think that it might only happen after a reboot and then sticks around. I ran the following command while I'm trying to pull a large dataset from another server to avoid overwhelming the data source. I'm worried that running this command multiple times could be contributing to my memory issues. Here's the command I used:
"[System.Environment]::SetEnvironmentVariable("Var", ($b), [System.EnvironmentVariableTarget]::User)"
Answers
Nope, that command by itself won't cause any memory errors. But the variable `$b` that you're using could be a factor. You didnโt mention whatโs in that variable, so itโs hard to tell. If itโs storing a huge amount of data (like your list of 30,000 items), that's worth looking into!
Reply to this answer
I think the command you shared looks harmless, but the way youโre using it matters. If `$b` has a massive array or objects, that might lead to memory problems, especially when converting it to JSON. Any chance you can confirm how much data is really being pulled in?
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions