Resolve hanldle leaks in Worker
If a Worker process in Windows gets stuck throwing the exception: "oshi.software.os.windows.WindowsOperatingSystem.updateProcessMapFromRegistry[:489] - Error 5 reading HKEY_PERFORMANCE_DATA from the registry", the application stops working, and a manual restart is required.
The issue with handle leaks refers to the used v3.9.1.1 OSHI library, with handles leaked even in the idle mode without processing any Business Processes.
The library is used to regularly get data about the Worker's process, like memory consumption (once per second). Sometimes, handles are not cleaned up properly during each iteration, totalling up to 10K handles per hour. If you restart Workers regularly, the issue will not occur.
However, you can slow down leaking handles by increasing intervals between getting the system information. Two new settings are introduced:
worker.execution.memory.heap.threshold.fixed.delay: time period between system information requests (in milliseconds, the default is 1,000)worker.execution.memory.heap.threshold.initial.delay: time period before starting getting the system information (in milliseconds, the default is 1,000)
To specify the settings as environment variables, perform the following steps:
Go to
RPA/bot-agent/conf/bot-agent-unit.ymlfor the server installation andRPA/worker/worker.batfor the VDI installation using the standard -D switch.Right after the
-Djvm.connector.path=../rpa-grid/dependency/jvm-connector.jarline, insert the following lines:-Dworker.execution.memory.heap.threshold.fixed.delay=60000 -Dworker.execution.memory.heap.threshold.initial.delay=120000Thus, the delay in getting the information is set to 2 minutes, and the interval between requests—to 1 minute.
Alternatively, you can upgrade the OSHI library to the newest version that resolves the issue or search for an alternative approach for getting the system data.