Out Of Memory while compiling method

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Alexander Johansson Alexander Johansson 2 years, 1 month ago.

  • Author
    Posts
  • #19852
    Profile photo of Erik Larsen
    Erik Larsen
    Participant

    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
    Profile photo of Alexander Johansson
    Alexander Johansson
    Participant

    Hello!

    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.

    /Alexander

You must be logged in to reply to this topic.