-
Notifications
You must be signed in to change notification settings - Fork 106
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
Don't allocate memory when ensuring capacity #102
Don't allocate memory when ensuring capacity #102
Conversation
Tnx. What error do you get when running tests? |
Wow, that was quick 😄 I get
My maven setup:
When do you plan to do the next release? |
I was planing around months end. Waiting for #99 and maybe I'll look in some map stuff. I've managed to reproduce the test issue on another machine. Tnx |
Would it be possible to do a bugfix release a bit earlier? We just went GA with the Elastic APM Java agent (and are big fans of DSL-JSON). But I'm a bit concerned that this could cause OOMEs in user's applications. |
Hm... ok. I'll look into releasing a new version early next week |
That would be really great! Thank you! |
I've released a new version just now. Please let me know if tests are working for you now. |
Thanks! I'll have a look and release a bugfix for our agent. |
See ngs-doo/dsl-json#102 for details
If you are having bad luck and the buffer is full while serializing a number, the buffer size doubles - even when the JsonWriter is underlying a target OutputStream. This has the potential to grow the buffer size indefinitely, leading to OOMEs.
See also this JMC screenshot from a flight recording which shows a huge allocation when calling
NumberConverter#serialize(int, JsonWriter)
->JsonWriter#ensureCapacity
. I hope this can be fixed soon :)I didn't get the tests to run so I couldn't test the change.