Possible memory leak when using NODISPLAY

Hi,

I was trying out using the nodisplay feature which hides the whole ui elements within UIV. As advertised, it sped up my macro that processes hundreds of elements and brought down its runtime to an hour instead of running for a couple of hours.

Though, so that I could at least glance on the UIV’s logs I’ve set the macro to disable the nodisplay feature on certain code points (4 of them) that I know will take a couple of seconds to do (e.g., loading another page or submitting a form).

But before an hour elapses, UIV starts to consume gigabytes of memory until the browser tab and UIV itself hangs, possibly due to the high memory usage.

Removing nodisplay solves the issue, trivially. Also removing those certain code points that disable the nodisplay feature also works and does not cause the macro to consume so much RAM. Thus, I think that the process of repeatedly writing ‘nodisplay’ then ‘FAST’ then ‘nodisplay’ to “!replayspeed” might have triggered the leak.

P.S. I would have attached a test macro for this but I am still figuring out how to do so here. :slight_smile: The test macro exacerbates the leak and compounds it in few minutes rather than hours. Tested affected on Linux (Google Chrome) and Windows (Edge). UI.Vision RPA 9.0.6.

Finally found it. Here’s the test macro.

{
  "Name": "Leak-nodisplay",
  "CreationDate": "2024-3-11",
  "Commands": [
    {
      "Command": "times",
      "Target": "300",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "FAST",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "FAST",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "FAST",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "FAST",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

Thanks for this very useful test case. I confirmed the issue and we will investigate this ASAP.

Hello,

I apologize ahead of time but it appears that I was worng when I said that:

Also removing those certain code points that disable the nodisplay feature also works and does not cause the macro to consume so much RAM

While it runs quick, on nodisplay mode, it also appears to leak memory the longer it stays on.

For example: Try this macro. Unlike the first one, this will take a while to execute as it simulates long running macros or macros with a lot of commands, or both.

{
  "Name": "memhog-nodisplay",
  "CreationDate": "2024-3-12",
  "Commands": [
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "times",
      "Target": "9000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "string",
      "Value": "string_a",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "string",
      "Value": "string_a",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "string",
      "Value": "string_a",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "string",
      "Value": "string_a",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "60000",
      "Value": "",
      "Description": ""
    }
  ]
}

I can only test this on Linux, Chrome 122, UI.Vision 9.0.6, and on nodisplay, after it was done, it stayed well over 600MB.

Without nodisplay, it peaked around 350MB but then reduced to around … 210 MB after it executes.

I tested this again on 9.1.3 and the issue seems to have been solved. The memory does not grow uncontrollably anymore