7.3. "java.net.BindException: Address already in use: connect” issue on Windows

Windows will only make outbound TCP/IP connections using ports 1024-5000 by default, and takes up to 4 minutes to recycle them. So in the case of runnung a load type performance tests the port range is filled pretty fast.

To allow higher values for ports on Windows add this parameter to the system registers:

  1. Start Registry Editor
  2. Find the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters subkey in the registry.
  3. Right-clicking on the Parameters create a new DWORD value with the name of MaxUserPort.
  4. Right-clicking on the MaxUserPort edit the value to 65534 as decimal.
  5. Reboot the Windows.