dotnet / dotnet/aspnetcore

NewtonsoftJsonResultExecutor disregards MvcNewtonsoftJsonOptions.OutputFormatterMemoryBufferThreshold

Open
#49,007 0 comments 0 reactions 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

I'm not sure if this is by design, but it's different from NewtonsoftJsonOutputFormatter.
https://github.com/dotnet/aspnetcore/blob/213eb282fc6d9ce07a1e0a1fbe526c297694ebf6/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonResultExecutor.cs#L98
https://github.com/dotnet/aspnetcore/blob/213eb282fc6d9ce07a1e0a1fbe526c297694ebf6/src/Mvc/Mvc.NewtonsoftJson/src/NewtonsoftJsonOutputFormatter.cs#L148
We return big collection result sometimes exceeds the default 32K memory buffer.
And we have following questions:
- We plan to set OutputFormatterMemoryBufferThreshold to 8M, is there any bad effect of such a big memory buffer size?
- Is it recommended to set SuppressOutputFormatterBuffering true and allow synchronous IO when using Mvc.Newtonsoft? I guess synchronous IO must be allowed in this case?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.