Out Of Memory while compiling method

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Johansson 3 years, 9 months ago.

  • Author
  • #19852

    Erik Larsen

    While running a command like this one

    Invoke-Command -ComputerName remotemachine -Credential $cred -scriptBlock {& C:\Windows\Microsoft.Net\Framework64\v4.0.30319\ngen.exe install C:\Assemblies\my.dll /verbose}

    we encounter this error "Out Of Memory while compiling method ..."

    If we run the command locally on the remotemachine it works fine.

    Anyone have any suggestions?

  • #19853

    Alexander Johansson


    You might be running out of memory in the remote session, try the following:

    Get-Item wsman:localhost\Shell\MaxMemoryPerShellMB

    You can then set the maxvalue with this command and see if it helps:

    Set-Item wsman:localhost\Shell\MaxMemoryPerShellMB 1024

    Where 1024 is an example value.


You must be logged in to reply to this topic.