Error System.OutOfMemoryException in serialize big data

Dec 2, 2014 at 3:16 PM
I'm trying to serialize to file a list objects with 190,000 records. The problem is when you try to do this, it gives the error:


My code:
File.WriteAllText("C:\\test.json", JsonConvert.SerializeObject(users));
how to do this? Is it a limit of Json.Net
Jan 29, 2015 at 3:54 PM
Did you get any solution for this?
Feb 16, 2015 at 3:23 PM
Hello mtsys

Did you find solution of this problem?
I have similar error but I could not any solution on the internet?
Apr 18, 2015 at 11:36 PM
I am getting OutOfMemoryException too, looking for solution.

byte[] byteData = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message));

"message" is a class holding a payload of an array of doubles, 3300 rows, 500 columns. Sometimes it goes fine, sometimes it throws the error.