Issue: Some activities, such as OCR, may utilize all available CPU cores, which might lead to conflicts when other performance-intensive background tasks are running.
Solution: To limit the CPU utilization of the activities, do the following:
-
Place the Invoke VB Code activity before your OCR Activity, preferably right at the start of your process.
-
Click Edit Code and insert the following code:
System.Diagnostics.Process.GetCurrentProcess().ProcessorAffinity = New IntPtr(5)
This code sets the CPU affinity of the process to the first and third core, so that the process does not utilize all CPU cores and background tasks performance is not affected.