JsonResult上的OutOfMemoryException

时间:2017-05-29 13:41:34

标签: c# json

我使用JsonResult Object发送一个float数组。 float数组有13M项,它代表一个wav文件:

public JsonResult GetWavFile()
{
     //...
     var jsonResult = Json(floatArray, JsonRequestBehavior.AllowGet);
     jsonResult.MaxJsonLength = int.MaxValue;
     return jsonResult;
}

我收到异常OutOfMemoryException。

这个link只讨论ciruclar引用,这不是我的情况。当float数组小于2M的项目时,它没有任何异常。有什么想法请问如何解决这个问题? (我不喜欢使用块)

0 个答案:

没有答案
相关问题