Apply same fix as PR #4831 to address Windows JVM memory error #4595