The following error occurs when the Java Virtual Machine (JVM) runs out of memory during instrumentation. It's typically caused by using a 32-bit version of Java, which has limited memory allocation capabilities.
System.InvalidOperationException: Failed to recompile the instrumented code...
Caused by: java.lang.OutOfMemoryError: Java heap spaceSolution
To resolve the issue:
Uninstall any 32-bit Java version currently installed on your machine.
-
Download and install a 64-bit Java Development Kit (JDK):
You can use the official Oracle JDK or OpenJDK.
Ensure the JDK includes the 64-Bit Server VM.
Restart Ranorex Studio to apply the changes.
Retry the instrumentation process.
Verify Your Java Version
To confirm that you're using a 64-bit version of Java, run the following command in your terminal or PowerShell:
java -versionA correct 64-bit installation will display output similar to:
openjdk version "1.8.0_392"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_392-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.392-b08, mixed mode)If the output does not mention 64-Bit Server VM, you may still be using a 32-bit version and should reinstall Java accordingly.