How should handle System.OutOfMemoryException exception while parsing a large string which is coming as an API Response.
I am getting this exception while parsing a large string
Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException OutOfMemoryException System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at Newtonsoft.Json.Linq.JToken.SetLineInfo(IJsonLineInfo lineInfo, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
This is the simple code that I am running.
var jObject= JObject.Parse(responseString);