You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have database entities for Entity Framework that are being serialized. This code worked fine with .NET 7, but now that we are upgrading to .NET 8, it is apparently no longer ignoring self-references, even though we still have this code:
message_data = JsonConvert.SerializeObject(data, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore}),
Expected behavior
The objects get serialized
Actual behavior
Memory continues to grow until the OS runs out
Steps to reproduce
Seeabove
The text was updated successfully, but these errors were encountered:
No, these are not steps to reproduce. That's like saying the recipe for chocolate cookies is: Bake!
Arguably, providing a relatively compact code example that reproduces this issue might be difficult, since you are using EF.
Arguably, the issue might perhaps not even be within Newtonsoft.Json but in some other piece of code that is being called by Newtonsoft.Json. Like for example, custom equality comparers (either coded by you or auto-generated by EF or some other code generator) which might be called by Newtonsoft.Json to figure out equality of instances for detecting reference loops.
There are so far no other issues reported that match your brief description as far as i am aware, and i can't imagine how a mere migration to .NET 8 would cause this. I suppose other things got updated as well in your project, not just a mere change of the target framework to .NET 8. But now i am just starting to read tea leaves... Therefore, the only advice i -- as another user of this library -- can give is that you thoroughly troubleshoot and profile your code with the data that triggers the runaway memory allocation.
Source/destination types
We have database entities for Entity Framework that are being serialized. This code worked fine with .NET 7, but now that we are upgrading to .NET 8, it is apparently no longer ignoring self-references, even though we still have this code:
Expected behavior
The objects get serialized
Actual behavior
Memory continues to grow until the OS runs out
Steps to reproduce
The text was updated successfully, but these errors were encountered: