Help Center/ Migration Center/ FAQs/ Server Migration/ What Can I Do If the StartUpAgent Step Fails and the Error Message "System.OutOfMemoryException" Is Displayed?
Updated on 2024-11-30 GMT+08:00

What Can I Do If the StartUpAgent Step Fails and the Error Message "System.OutOfMemoryException" Is Displayed?

Symptom

The migration workflow failed at the StartUpAgent step, and the error message "System.OutOfMemoryException" was displayed.

Possible Causes

Edge uses WinRM to connect to the source server for script transmission and execution. This problem occurs if there is not enough memory for executing the script.

Solution

  1. Check and modify the PowerShell memory configuration.

    Run the following command in PowerShell on the source server to check the memory allocated for PowerShell:
    Get-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB
    • If the configured memory is too small, run the following command to increase the memory to 1024 MB and retry the migration task. If the fault persists, go to step 2.
      Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024
    • If the configure memory is not less than 1024 MB, go to Step 2.

  2. Handle the memory limit problem in OSs of old versions.

    If the source server uses an earlier version of OS, for example, Windows Server 2008 or Windows Server 2012, the WinRM service may not apply the value defined by MaxMemoryPerShellMB. Instead, it uses the default value, which is typically 150 MB. In this case, the script may be interrupted due to insufficient memory. To handle this issue, perform the following operations:

    1. Sign in to the Huawei Cloud SMS console. On the Agents page, download the Windows Agent (Python 2) installation package to the source server.
    2. Install and run the Agent. Enter the AK/SK pair of your Huawei Cloud account and SMS domain name to start the Agent. For details, see Installing the Agent on Windows.
    3. After the Agent is started, return to the MgC console and retry the migration task.