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


#1

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.


#2

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?


#3

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
https://www.codeproject.com/Articles/1095402/Garbage-Collection-and-Csharp

Regards,
Arivu :slight_smile: