Datatable out of memory exception

Hello pro, I have a datatable of 150,000 records and when I select from database using uipat it works well but when the records increased to 1,300,000, I get uipath out of memory exception.Please how do I resolve this?

It seems that you are trying to put in memory a lot of data. What is the origin of that datatable? Have you considered querying data in parts?

The origin is from database

Have you checked memory usage in Task manager when running that process?

uipath studio memory in task manager is 241.2mb

Can you provide more information regarding task manager when running that process?

Memory in percentage is 40-53%, UiPat Executor - 1945.8mb

This may be helpful in your case Large Data and DataTable to DataSet - RPA Component | UiPath Marketplace

Hi,

Can you share your expression that occurs error?

Regards,

1 Like

Hi,

Can you share which statement has exception?

It seems the above consume memory for 2 large datatable. For now, can you load data to datatable directly like output.Load(reader) ?

Regards,

Hi Yoichi, I need to get the output result and write to excel but the line output.Load(reader) doesn’t get the ouput, how do I get it so it doesn’t consume much memory

Hi,

Do you use InvokeCode activity? And which argument type is the “output”? For now, Can you try “output” as In type argument?

Regards,

I used invoke code: So here, dt has already been declared as shown above, so to get the value as out argument I used output = dt.Copy() as output is in direction out and a datatable but the issue is the memory leakage, is there workaround

Hi,

DataTable.Copy method duplicates datatable. This means it needs twice memory. In this case, Copy method should not be used to save memory, i think.

BTW, is your “output” argument set In at Direction as the following?

image

Regards,

Hi Yoichi, it worked well without Copy() method thanks, however I have another memory exception on another code

Hi,

however I have another memory exception on another code

Can you share the code (statement)?

Regards,

Out of memory exception cause the files are large, if I use smaller files, it works fine, pls how do I resolve?

Are you there?

Hi,

It might be too large to handle in UiPath process.
For now, need to check if there is logic to consume much memory.
Or the latest .net 5 base profile works as 64bit process. This might work.

Regards,

So you recommend checkingfor latest .net5 update or explain further please for clarity