Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU and memory penalty when using certain types in userCustomData in RaygunClient.Send #404

Open
ghost opened this issue Mar 4, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2019

We had experienced one of our critical apps spiking CPU usage to 100%, allocating multiple GBs of memory and sometimes dying all together when trying to call RaygunClient.Send with userCustomData dictionary that has a value with one of the nested properties of type System.Exception.

Looking at the source code, it seems like .NET RaygunClient has a custom json-serialization (SimpleJson) that is not able to serialize Exception objects correctly. Depending on the exception's TargetSite the library allocates huge amount of memory and takes over the CPU.

I understand that using Exception properties in userCustomData is probably not advisable from error-reporting perspective. And it was not intentional on our side. However, I think this behavior should be considered erroneous because JSON serialization of Exception should not be done the way it is implemented in SimpleJson. For example, Newtonsoft.JSON does not have this problem because it relies on ISerializable implementation of Exception when serializing to json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants