Internal error: Exception of type 'System.OutOfMemoryException' was thrown

I’m using groupdocs conversion cloud deployed on my server but when I try to convert 50mb xls file its giving error
Internal error: Exception of type ‘System.OutOfMemoryException’ was thrown
I’m using the following API /v2.0/conversion?format=pdf&fromPage=1&pagesCount=0

Screenshot 2024-09-05 at 6.43.48 PM.png (84.7 KB)
Screenshot 2024-09-05 at 6.43.48 PM.png (84.7 KB)

Hi, please confirm that you’re using self-hosted version of GroupDocs.Conversion Cloud, also please share image tag, and attach the input file, if possible, that cause the error, so we can reproduce the issue, Thanks!

yes we are using self-hosted version of GroupDocs.Conversion Cloud
groupdocs/conversion-cloud:24.5b-alpine

strong text Loading Google Sheets

Cannot open the link. Is it was an input file?

try now @sergei.terentev Loading Google Sheets

@sopan09
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONCLOUD-588

@sergei.terentev We are a paid customer is there any other support for paid customer

Ok, sure, I have set “Paid customer” priority for this ticket

is there a way to track

Issue ID(s): CONVERSIONCLOUD-588

I think no, but a notification will be posted in this topic, once the ticket is fixed. Also I will notify about the results of issue investigation status.

Hi, we tried to reproduce the issue, but the file was successfully converted to pdf using latest version of GroupDocs.Conversion Cloud self hosted.
Here is the resulting file:

Please try to pull the latest version of GroupDocs.Conversion Cloud and try again. Also, please ensure that your docker container has enough memory and CPU resourcers. We tested with 8GB RAM, but peak consumption was 2GB.

Here is the latest alpine version:
https://hub.docker.com/layers/groupdocs/conversion-cloud/24.8-alpine/images/sha256-328f52b9f6ddc49998cab5f3dda238eed432a0a1ee9711b474c446e6681bdcd3?context=repo

You can also try the image tagged with ‘latest’ tag, it also works well.

Please notify if you still have an issue.

Is it possible to use streams in this API?, if yes, could you please share any doc or example related this

Hi, yes, the API has ability to convert documents using streams:
here is the documentation page:

Hey!
In the example you shared its passing the complete file not the stream of file

Sorry, there is no other API methods that work with file streams

I’m asking that I’m Using /v2.0/conversion API can this be work with stream, If yes then can you please share a doc for that.
Earlier you said: yes, the API has ability to convert documents using streams
but the document you share doesnot have any example related to streams.
could you please properly explain this

Sure, for example, let’s take a c# example
As we can see, the API method, that performs conversion, take a stream as an argument. This can be not exactly file stream, but any other stream:

var request = new ConvertDocumentDirectRequest("pdf", fileStream, null, null, loadOptions);
var response = apiInstance.ConvertDocumentDirect(request);

But in this example, a file stream used to create a stream, and it’s initialized from a file:

var fileStream = File.Open("..\\..\\..\\Resources\\WordProcessing\\password-protected.docx", FileMode.Open);

This is done so for example only, but in you code, you may initialize the stream using other way, from a database, or network.

Hey!
Is there a why to optimize memory consumption as consumption was 2GB for only 50mb file this is so huge, we have a use case where we can convert much larger files 1gb-2gb. Then what will be the peak memory consumption? if its much higher then this will significantly increase the cost.

Please look into this and suggest a way to consume less memory

Also, the example you shared look like its for SDK not for API,
We are using node and make a axios call to the conversion API
also, above example is not using streams properly

@sergei.terentev any update on this

Hi, we didn’t test large files, like 1 or 2 Gb. If you are using self-hosted version, I’d suggest to look at other non-cloud products, like .NET, Java, or Node.js via Java versions.
Yes, the example is SDK example, but, of course, you are free to call the API using any other method. SDK is just offers one of the ways.
I’m not get what do you mean: “above example is not using streams properly”