#1 2017-09-06 21:23:01

polidados
Member
From: Brazil
Registered: 2017-03-08
Posts: 14

Out Of Memory due to huge out RawUTF8 parameter

Hello!

In a method of an interface based service I get an 'Out of Memory' error when an out RawUTF8 parameter gets too large.
How can I tell the client that such error occurred? Because it happens after my method exited.
What is the proper size for such parameter to return?

Last edited by polidados (2017-09-06 21:24:31)

Offline

#2 2017-09-07 06:48:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Out Of Memory due to huge out RawUTF8 parameter

All parameter values will be serialized as JSON during SOA calls. So you would need twice the RAM as the raw content. Note also that BLOBs are base-64 encoded, so it is more than twice the RAM for them.
So you should better stay in a reasonable size, e.g. a few MB.

If you expect to send big information to a server, consider paging your content into smaller pieces.
If you expect to receive big information from a server, consider using TServiceCustomAnswer kind of answer - and also that you could efficiently return a file content without any memory copy (under http.sys).
You may also consider method-based services, if you want full access to the remote HTTP request.

Or you may also compile the server in 64-bit mode, if you have enough RAM to hold all the info at once.
But IMHO it is not a good idea, due to network limitations, since the process will be blocking for a long time, from the client side.

Offline

#3 2017-09-08 11:34:43

polidados
Member
From: Brazil
Registered: 2017-03-08
Posts: 14

Re: Out Of Memory due to huge out RawUTF8 parameter

Ok. I'll see what is best for my case based on your input.

Thank you, ab!

Offline

Board footer

Powered by FluxBB