PowerShell Memory

Welcome Forums General PowerShell Q&A PowerShell Memory

This topic contains 1 reply, has 2 voices, and was last updated by

3 years ago.

  • Author
  • #44859

    Topics: 4
    Replies: 4
    Points: 3
    Rank: Member

    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

    Topics: 13
    Replies: 4872
    Points: 1,842
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘PowerShell Memory’ is closed to new replies.