cancel
Showing results for 
Search instead for 
Did you mean: 

Out of memory exception while saving attachment

hkhader
Level 3
Hi,
I am getting Out of Memory exception while saving the attachment using "Microsoft 365 Outlook" VBO. The attachment is approximately 6 MB.

Thanks,
Halid

------------------------------
Halid Mohamed Niyaz Abdul
------------------------------
5 REPLIES 5

PvD_SE
Level 12
Hi Halid,

A  lot has been written about the infamous OutOfMemory error, but not that I recall when sending email. See also the 'Related content' section at the bottom of this screen.

Also solutions such as GarbageCollection have been suggested before, and seem to have given results in some cases. 

However, I assume most tips provided for on this forum would apply even to your case. While 6Mb may sound rather small to get this error, it is likely the combination of juggling Outlook and the attachment that is the showstopper here. 

In our office, our processes never send attachments in email. Instead, we copy the link to the document into our email body. But obviously, this only works when your email is an internal email and where the recipient has access to its location.

------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

ewilson
Staff
Staff
Hello @hkhader,

A few questions for you:

  1. What version of Blue Prism are you using?
  2. How much memory does your system have (ex. 32MB)?
  3. Is there just one attachment on the email? Are there any embedded images (those are actually treated as attachments too)?
  4. What is the file type of the attachment (ex. PDF)?
  5. Have you tried stepping through the Save Attachments action to see which stage it's on when the out-of-memory error occurs? 

​While your attachment may show as 6MB in File Explorer it's actually a bit bigger with the Graph API because the binary content of the file is base64 encoded so that it can be represented in the JSON payload that Graph returns to us. So the actual attachment size is probably close to 8-9MB. Still not huge though by todays standards.

The way the Save Attachments action works is that it first makes a request to Microsoft to get the attachments for the specific email. Graph returns a JSON payload to us that includes all attachments including any inline images (ex. company logo in the signature). We then convert that raw JSON to a Blue Prism Collection that contains one row for each attachment. That Collection is then passed into a Code stage that performs the actual writing of the attachment(s) to disk. 

What I'm trying to understand is whether you're seeing the error during the conversion of the raw JSON to a BP Collection or if it's in the actual writing of the attachments to disk. Does that make sense?

Cheers,

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

Hi Eric,
Thanks for quick reply.

Here are my answers,

  1. What version of Blue Prism are you using? - 6.10.1
  2. How much memory does your system have (ex. 32MB)? 64 GB, Windows Server
  3. Is there just one attachment on the email? Are there any embedded images (those are actually treated as attachments too)? One attachment and our company logo in the signature
  4. What is the file type of the attachment (ex. PDF)? - CSV
  5. Have you tried stepping through the Save Attachments action to see which stage it's on when the out-of-memory error occurs?  yes. It failed in ConvertoDataTable
Thanks,
Halid

------------------------------
Halid Mohamed Niyaz Abdul
------------------------------

Hi Eric,
Any luck on the below issue?

Thanks,
Halid

------------------------------
Halid Mohamed Niyaz Abdul
------------------------------

Hello @hkhader,

Unfortunately no. Is there any chance that you can share the specific CSV you're working with?

Have you tried calling the Get Attachments action instead of the Save Attachments action and saving the file to disk using the Utility - File Management VBO?

Cheers,

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