Out of memory exceptions and collection clean up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-11-21 06:00 PM
Not emptying Collections when the Process or Object no longer requires them to exist (e.g. Remove Null Rows, Remove Empty Rows or Remove All Rows)
Once the process completes, will the collections used by the process/objects be freed automatically? I always assumed this was the case, that once a process completes any internal collections would be freed automatically by Blue Prism. The specific robot running into the out of memory issues is dealing with collections - small ones - but it runs many processes with many small collections many times. If for some reason the collections are not freed automatically when a process completes, then it would likely be the source of my issue.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-11-21 07:19 PM
As per the concept of Business Objects, whenever you call Business Objects from a process, the memory is consumed till the parent process is active. If your process is interacting with a large set of data such as collections with huge number of rows as well, the memory consumed could exceed the memory that gets freed periodically by your Operating System. In past, we have faced such issues while interacting with excel files having 50000+ rows and in order to resolve this we created a custom business object and used a code stage to forcefully invoke the Garbage Collector via VB .NET. You can create an action and add a code stage, there just include the function: GC.Collect()
You should be able to reclaim some of the memory in order to have enough space to carry out your process. Let us know if it helps
------------------------------
Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-11-21 07:51 PM
The reason I am wondering if there is something being persisted beyond the process level is because the problem only occurs after a couple of days of running processes (it runs upwards of 700 sessions across five or six different processes per day). That is why I suspect there may be something being persisted beyond the process level. Restarting Blue Prism resolves the out of memory exception when it occurs.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-11-21 11:09 AM
did you try to turn on Log Memory Usage? That could give you some insight why it is happening, however, bear in mind that it increases the space consumption for the logging in your database.
Regards
Zdenek
------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
29-11-21 02:55 PM
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
29-11-21 03:41 PM
------------------------------
Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blueprism 6x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-11-21 07:26 AM
------------------------------
John Carter
Professional Services
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-12-21 07:51 PM
I am still curious why this happens, particularly because there is always free memory available and automate.exe is usually taking a mere 300 MB when the exceptions start to occur. In my experience in C# and .NET applications, I usually hit a couple of GB before I run into out of memory exceptions (that makes my coding sound pretty bad, lol). Unfortunately, I think that's too intricate of a question to determine easily.
------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-12-21 08:14 AM
When you pass huge collection in/out of VBO action, it stays within that action consuming memory until process ends by design (or until you call that action again with another input). What I did to remedy this problem in collection manipulation for example:
1) Moved all inputs to Init page and made them public.
2) Created an action to clean up and run GC
Then it works like this:
1) Call Filter collection action, get data back - collection data also stays in VBO at that point
2) Call Clean up action that does clean up inside VBO - memory is released.
The only problem that approach is that you better always run that clean up, or you might end up with stale data sometimes as public data items wont clean on every action call anymore.
In extreme cases, you might just as well just merge everything into a single VBO, avoiding any data copy altogether, but this is a last resort and won't work that well for Excel VBO for example that has to keep it's state.
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-12-21 06:04 PM
In my particular case, the collections are relatively small - they're all single row - but there is a text field within them that can range from a few characters to ten thousand. It at most gets passed a single time into an underlying object.
As far as the way you perform cleanup, are you calling something that runs
GC.Collect()
, or do you do anything further like empty the collections first?------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------
