cancel
Showing results for 
Search instead for 
Did you mean: 

Memory usage causes hang ups

EdBailey
Level 3
Hi I've built a process that looks for emails delivered to a mailbox. Where it finds an email with the correct subject and attachment it opens the attachment (a MS Excel file) and carries out a number of checks/calculations on the data within, sometimes comparing against previously recorded data in a database held on a network share (again a MS Excel file).  Depending on whether the checks are passed or not it either saves the file or writes an error report (again using MS Excel) This all works fine for the first attachment but where it starts to run into problems is after its processed a number of the attachments memory used by automate.exe creeps up and up until the process hangs and I get the error 'Exception when generating display.Exception of type "System.OutOfMemory" was thrown' The problem is not caused by blank rows in a collection as the process is not importing the excel document into a collection but rather reading cell values using the MS Excel VBO. This is because of the lay out of the data in the Excel file. The are regular points in the process when moving between different files where Excel is closed and its process stopped/killed .  I've also tried using a 'clear clipboard' action to see if it helps reduce the memory usage but it does not have any discernible affect. I've not built a queue and shared the work between computers as that would require a human intervention in checking the emails and saving the attachments as inputs files, something that is not desired at this point.  Adding more memory to the computer running the process is probably not practical. I'd welcome any suggestions as to how resolve this issue 🙂   
3 REPLIES 3

Denis__Dennehy
Level 15
There are knowledgebase articles and other threads in this forum that can all be searched for recommendations with this issues.   Solutions involve re-orchestrating your use of large Excel files so you are not loading all data into a collection at once and passing it about in parameters (duplicating it each time) also recommedation in the knowledgebase involves. invoking the .NET garbage collector in a code stage.   Have a search around.

EdBailey
Level 3
Thanks Denis, I've found a very useful article in the KB that helps with my issue. Sorry for not checking their first! 🙂

EdBailey
Level 3
I used this KB article to implement a solution using its suggestion to empty collections and then recycle the garbage  https://portal.blueprism.com/customer-support/knowledge-base/are-there-… This works if I step through the process but not if I run it. I created a test by simply the 'Collect Garbage' action at a point in the process where I know the collections are empty but memory usage high. I think that this eliminates the cause being related to any of the other objects that are outlined in the article (such as the calculations to empty the collections etc) Does anyone have any suggestion as to why the code stage only recycles the garbage if I step through it?