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've noticed huge spikes in garbage collection time when an upstream to the graphql service starts timing out. JFR recordings show 41GB byte[] allocations followed by 5.54GB StringBuilder and another 3.41GB in String allocations. This is during a 60s sample when the service have upstream issues.
Most/all of this come from the error reporting doing toString() on the client responses stating something similar to the example below. These will repeat for each item missing which is generating a ton of garbage. I have two questions;
Can I modify the "stacktrace" like error reporting for each field to something simpler just saying error?
Is there a way to stop the execution early on if a certain condition is met? For example if this field fail to resolve, stop and return an error.
So looking at the toString() method is defintely has a design fault. It references its parent ExecutionStepInfo which will reference its parent and so on.
So it creates more "strings" than is strictly needed. We will fix this
The reason it happens via NonNullableFieldExceptioon is this
You must have 10s of 1000s of erroring requests here to be generated so many strings (GBs of them) however. Out of interest how many requests are we talking and how many are in errors.
Yeah it's definitely toString() casing the issues and your PR will be an improvement to that.
Are the pretty toString's needed if there's nothing in the library reading them? Feels like an unnecessary overhead with strings that get thrown away.
Currently a few hundred RPS but we expect that to increase a lot. The problem that occur is that some of the responses contain lists with 10-50 items and the toString is triggered for each field
Activity
[-]Massive GCs when with failing upstreams[/-][+]Massive GCs with failing upstreams[/+]bbakerman commentedon Feb 17, 2020
So looking at the
toString()method is defintely has a design fault. It references its parent ExecutionStepInfo which will reference its parent and so on.So it creates more "strings" than is strictly needed. We will fix this
The reason it happens via NonNullableFieldExceptioon is this
It causes a call to
.toString()on the throwable as a message (when there is no message)which calls
So the extra strings are coming from that.
You must have 10s of 1000s of erroring requests here to be generated so many strings (GBs of them) however. Out of interest how many requests are we talking and how many are in errors.
jhaals commentedon Feb 17, 2020
Yeah it's definitely
toString()casing the issues and your PR will be an improvement to that.Are the pretty toString's needed if there's nothing in the library reading them? Feels like an unnecessary overhead with strings that get thrown away.
Currently a few hundred RPS but we expect that to increase a lot. The problem that occur is that some of the responses contain lists with 10-50 items and the toString is triggered for each field
jhaals commentedon Aug 27, 2020
Closing since this has been addressed in #1792