Skip to content

JsonSerializerOptions memory leak? #24230

Answered by shawndewet
shawndewet asked this question in General
Discussion options

You must be logged in to vote

Thanks for the above pointers.
It turns out that in my building of the custom fields into the object being returned, it was actually returning an object and not a dynamic. This was causing the JsonSerializerOptions to cache each object result individually. I have now changed the code to ensure it returns a dynamic, and it seems this is (correctly) NOT being cached.
The unbounded memory creep seems to have dissipated.

Replies: 5 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@pranavkm
Comment options

@shawndewet
Comment options

@pranavkm
Comment options

@shawndewet
Comment options

@steveharter
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pranavkm
Comment options

Answer selected by shawndewet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants