Out of memory exception trying to upload large file

joao.figueira

Posted on
May 08 2020

Hi, I have a asp.net web api which contains a action that uploads files using stream (in some cases, big large files).

MyAction

Using raygun, it seems like it is buffering the file causing a Out of memory exception. Evidence here: OutOfMemoryExceptionOnPostMan

When I dont add the Raygun to the pipeline, all works just fine.

What can I do to prevent raygun from buffering the file?

Mindscape.Raygun4Net.Core: 5.10.2

Mindscape.Raygun4Net.WebApi: 5.10.2

WebApi framework: 4.7.2


Deleted User

Raygun

Posted on
May 11 2020

Hi Joao,

Thank you for getting in touch with us. That appears to be an issue when our client attempts to read the raw data from a failed http request. The simple way to avoid this issue is to disable the raw data from being read. This can be done by modifying your setting either through using the following snippet in your config.

<RaygunSettings apikey="YOUR_APP_API_KEY" isRawDataIgnored="true" />

Or applying the setting before attaching the Raygun client. This can be done with the following snippet.

RaygunSettings.Settings.IsRawDataIgnored = true;
RaygunWebApiClient.Attach(config);

I will make a note of this issue for our Crash Reporting team to follow up on. Please let me know if this solution is suitable for your situation.

Thank you, Mitchell.


joao.figueira

Posted on
May 11 2020

Thanks, Mithcell. Your answer worked for me.


Deleted User

Raygun

Posted on
May 11 2020

You're welcome. Let us know if you have anymore questions.

Regards, Mitchell.


Reply