cancel
Showing results for 
Search instead for 
Did you mean: 

Out of memory exception

CharudattaKulka
Level 2

Why do we get out of memory exception? and how to fix it?



------------------------------
Charudatta Kulkarni
------------------------------
3 REPLIES 3

Mukeshh_k
MVP

Hi @CharudattaKulka 

This has to do with RAM usage of your resource PC.

  1. These generally in most of the relevant cases happens when you try to extra load a collection in BP Process. Try only loading the collection with workable data set i.e. load in batches to work with a task and empty the collection once done to load fresh entries.
  2. Optimize the process to reduce the amount of memory it requires by removing unnecessary objects, optimizing code, or using more efficient data structures, Also make sure you release the objects when they used and connect back when required. 

  3. Ensure that the system is not running other memory-intensive applications while the BP resource is processing the workload.

System Memory Out exceptions in Blue Prism occur when the Blue Prism Runtime Environment runs out of available memory to process the current workload. This can happen for several reasons, such as:

  1. The BP Run time resource is running multiple processes concurrently, and collectively, they require more memory than the system can provide.

  2. There is a memory leak in the process, which means that memory is being allocated but not released when it is no longer needed.

  3. The system is running other applications that are consuming significant memory resources.


------------------------------
Kindly up vote this as "Best Answer" if it adds value or resolves your query in anyway possible, happy to help.

Regards,

Mukesh Kumar - Senior Automation Developer

NHS England, United Kingdom, GB
------------------------------
Regards,

Mukesh Kumar

diane.sanzone
Level 7

Hi Charudatta,

I agree with Mukesh - sometimes it's just because you're trying to load too much into a collection at once (reading in a large Excel file, for example).  I found that my system usually errors at around 30,000 rows and 15 columns.  If, however, you're saying you get out of memory exceptions during process run and you're not reading in large data, this could be because you're not cleaning up properly.

I read somewhere (not sure if it was a forum post or BP documentation), that when you use a collection to store data during a process, Blue Prism doesn't clean that out when the page ends. It keeps that data resident in system memory until the process ends and the system does the overall cleanup. You can force the memory reclamation by removing all rows from a collection once you're finished working with it. I usually put a memory cleanup block at the end of each page for every collection I use that isn't output in my end stage (use collection - remove all rows for all collections used, put in a block with a recover/resume that passes straight to end, no need to terminate if this fails). This immediately reclaims the system memory and speeds everything up.

Hope this helps.



------------------------------
Diane Sanzone
------------------------------

ewilson
Staff
Staff

@CharudattaKulka

The important thing to understand is that the Blue Prism Automate.exe client is a 32-bit application. Because of that, it's limited to no more than 2GB of addressable memory. That's for the entire application. In reality, you'll actually have access to less than that because the operating system is loading the various Windows libraries necessary to run the 32-bit application into that space too.

So, if you're trying to load a huge CSV or spreadsheet, as examples, into memory in one chunk it's possible that you will run into an out-of-memory situation. To work around this, you need to consider your use case and see if there's something you can do to "chunk" the data you need to work with. If you search the community, you'll find a few threads that discuss chunking.

Alternatively, Blue Prism v7.2, which is upcoming, will be the first release of the product where the client application will be a true 64-bit application. That will drastically increase the amount of addressable memory available to your processes.

Cheers, 



------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------