How do find out what chews up host memory?

This topic contains 3 replies, has 2 voices, and was last updated by  Lauras Juozulynas 1 year, 10 months ago.

  • Author
    Posts
  • #32799

    GS
    Participant

    Hello,

    I have super simple script which causes Powershell to kill itself in remote session becouse of memory limit. After about 15 iterations host memory will be at 1 GB,

    Import-Module Webadministration
    for ($index = 0; $index -lt 50; $index++) {Get-ChildItem IIS:\AppPools | select -First 1 | set-itemproperty  -name enable32bitapponwin64 -value $false }
    
  • #32817

    Lauras Juozulynas
    Participant

    Hi,

    For me it looks like you are trying to set same setting on same AppPool for 50 times. Is that the intention?

    This is because you run your scriptblock 50 times, but in scriptbloc value is always the same (no reference to $index).

    Lauras

  • #32818

    GS
    Participant

    No, this is for illustration purposes only. I have to modify 5 different settings within each application pool and if I have more then 3 application pools on my machine then Powershell will stop working because of memory leak.

  • #32823

    Lauras Juozulynas
    Participant

    Just a guess:
    Can it be that changes are executed too fast? Try adding sleep in between commands.

You must be logged in to reply to this topic.