Can we flush memory at the runtime during UiPath script execution?

Is there any way we can flush the memory at the runtime? I am trying to run multiple flowcharts one by one from one flowchart using invoke workflow file activity for each flowchart. So, is there any way, we can flush the memory occupied, at the end of each flowchart and keep the outof memory issue away.

You could try with GC.Collect methods.
But if you’re running into oom issues, it might be you’re not releasing references to your objects, so GC can’t release it in its own.

Scenario you are describing shouldnt on its own create memory issues, so there is probably something else going on.
Are you reading big files and passing readouts around?

Hi @jayesh.nadkar,

Using Garbage Collection you can flush the memory in the run time also.

based on you process you need to flush the memory if surly not requied.

Refer the below link

Arivu :slight_smile:

Are we supposed to be clear the GC during the execution? Is this suggestable?

1 Like

Hi @andrzej.kniola. I am getting memory out issues and Robot service is getting stopped after some point of time. Please advice what to do on this case.


  1. Avoid of making large Process
  2. Avoid of having large Library
  3. Avoid of having passing many information during running the robot (you can breakdown the process)
  4. Think about the rest time of robot (Stop and Start)