Error occurred during initialization of VM | WinRM

DevOps

Windows remote management is always a tricky job as you have to take care of amny aspects starting from timeouts to memory per shell and connectivity. Out of all tools available for windoes remote management WinRM is used most as its default software and reliable but few times you would have seen errors like “Could not reserve enough space for object heap” or “Error occurred during initialization of VM” while trying to run a program over WinRM. Even most of administrators use WinRM in Rundeck to execute commands in remote windows machines. This articles errors are common to WiRM implementation though we had faced them while running remote commands via RunDeck software. The issue can be resolved by following below mentioned steps:


ADVERTISEMENT

Errors Seen :

Error occurred during initialization of VM
Could not reserve enough space for object heap

Or

Error: Could not create the Java Virtual Machine.
Error occurred during initialization of VM
Error: A fatal exception has occurred. Program will exit.
Unable to allocate 51776KB bitmaps for parallel garbage collection for the requested 1656832KB heap.

Error Seen in RunDeck Job run:
WinRM error in Rundeck

Solution:

This issue is generally due to WinRM shell “MaxMemoryPerShellMB” value set to very less value. So you have to complete following steps to increase the Max Memory value per shell and make ti work.

  1. Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator.
  2. In the command prompt window, type the following command, and press Enter after each command:
winrm qc -q

 

winrm set winrm/config/service/auth @{CredSSP="True"}

 

winrm set winrm/config/winrs @{AllowRemoteShellAccess="True"}

 

winrm set winrm/config/winrs @{MaxMemoryPerShellMB="2048"}

MaxMemoryPerSHell WinRM

  1. Type exit, and then press Enter.

All above steps shall resolve the “Error occurred during initialization of VM” issue in WinRM.

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply