Newtonsoft.Json - Out of memory exception while deserializing big object

后端 未结 1 581
甜味超标
甜味超标 2021-01-18 04:37

I have a problem deserializing a JSON file of about 1GB. When I run the following code I get an out of memory exception:

using (FileStream sr = new FileStrea         


        
1条回答
  •  粉色の甜心
    2021-01-18 05:18

    According to Newtonsoft.Json Performance Tips your approach has to work (because you read via stream and it should make portion from your file). I can't figure out why your code doesn't work.

    But you can try another approach, that was described in the next article - Parsing Big Records with Json.NET

    0 讨论(0)
提交回复
热议问题