PowerShell Memory

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44859
    Profile photo of Vick B
    Vick B
    Participant

    Hi Experts,

    I've been wondering about how memory works in PowerShell and was hoping someone can share their insight on the topic.

    – when should we consider changing the default memory size?
    – what are the considerations that go into making a decision?
    – is there any general practice involved if the memory size requires to change due to buggy snapins?
    – what potential components can be impacted if memory size is changed?

    Any feedback is always appreciated.

    Reference: https://blogs.technet.microsoft.com/heyscriptingguy/2013/07/30/learn-how-to-configure-powershell-memory/

    #44874
    Profile photo of Don Jones
    Don Jones
    Keymaster

    That's actually adjusting memory size for Remoting endpoints, not your local shell. Personally, I've not run into a situation where I needed to adjust it. Certainly, if you were running commands that used enormous data sets, and were running out of memory, you might need to give it a bump – and that isn't a "consideration," it's, "oh, we ran out of memory." It's not a technique you'd use to somehow combat a buggy module. Apart from old snapins (not modules) that are wrappers around COM objects (like the Quest snapin mentioned in that article's comments), you're probably not going to run into memory leaks much.

    Personally, I've never needed to do this. Just because you can, doesn't mean you often need to. I'd leave it alone unless you know you're getting memory-bound on something (KNOW, not guess), and then bump the memory appropriately. Or rewrite your command/script so that it doesn't need so much memory.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.