Starting with the release of Windows Collector version 19.253-3 with the Amazon Correto JRE, the installation can fail with out-of-memory errors when using automation tools such as Ansible. This is due to memory allocation limits on WinRM (Windows Remote Management). Please note that the manual installation of the Windows Collector is not affected by this.
Example of the out-of-memory error:
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
In order to solve this issue, the memory allocation of WinRM needs to be increased.
Run this command on a Powershell window to get the current memory allocation value, we are looking for the value of the "MaxMemoryPerShellMB" parameter.
winrm get winrm/config
If the value is 512MB or less, increase this to 768MB or 1024MB by running this command:
Set-Item -Path WSMan:\localhost\Shell\MaxMemoryPerShellMB -Value 1024
Restart the WinRM service:
Restart-Service -Name WinRM
If you get an error that the config setting "MaxMemoryPerShellMB" cannot be changed because is controlled by policies, then you will have to update your GPO policies. You can also update this parameter via the Registry (Regedit) by searching for "MaxMemoryPerShellMB" and changing the "Max Value" to 1073741824.
If you continue to have issues with the installation of the Windows Collector via automation tools, then please contact us at firstname.lastname@example.org.