Hi,
I have services on both ends. A service is passing large byte array to another service. But failing.
I have configured both services for large data. But I am getting Out of memory exception when calling the following code.
var data = JsonConvert.SerializeObject(bytes); // bytes is byte array of file approx size of 50mb.
//Create method Uri
var uri = new Uri(url);
using (HttpClient client = new HttpClient())
{
client.BaseAddress = new Uri(Utility.ServiceBaseUri);
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.Timeout = new TimeSpan(0, 10, 0);
HttpResponseMessage response = client.PostAsJsonAsync(uri.ToString(), data).Result; //Exception Out of memory....
if (response.IsSuccessStatusCode)
{
}
}
Loading

Abhishek KumarRank #510 · 4.8K reputationPosted Apr 7, 2015, 2:22 AM EDT
If you could try the below.
system.web> httpRuntime maxMessageLength="409600" executionTimeoutInSeconds="300"/> system.web> configuration> Hope this will help. Abhishekmursaleenfayyaz fayyazuddin34 reputationPosted Apr 7, 2015, 2:27 AM EDT
but not able to send.
file attached.
Abhishek KumarRank #510 · 4.8K reputationPosted Apr 7, 2015, 2:48 AM EDT
Hi,
Please check the machine where service is built and deployed.
With 64 bits machine there should not be any problem with memory limit.
Abhishek
mursaleenfayyaz fayyazuddin34 reputationPosted Apr 7, 2015, 3:31 AM EDT