Is My Command Causing Memory Issues on My PC?

April 26, 2025 2 answers
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

locker_key
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
beetle_6legs
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