Skip to content

Conversation

@franz1981
Copy link
Contributor

Since FasterXML/jackson-core#919 jackson now requires to close its JsonGenerator to save buffer leaks - and eventually cause further big allocations due to not be able to reuse the existing one.
This can be saved by correctly closing the used JsonGenerator.

@franz1981
Copy link
Contributor Author

@belugabehr 🙏

@franz1981
Copy link
Contributor Author

IDK @martin-g if the failure is related to this change

@franz1981
Copy link
Contributor Author

Hi @jbonofre it's Franz (I was working Artemis years ago) sorry for the naked ping but this one is causing some performance degradation to our Quarkus and Apicurio users, can you take a look? 🙏

@franz1981
Copy link
Contributor Author

@MichalFoksa there is anything I can do to help here, or anything I am missing? 🙏

@franz1981
Copy link
Contributor Author

Just for reference, this change is saving to allocate a fresh new 4K sized char[] buffer each time, see https://github.com/FasterXML/jackson-core/blob/bef7d7a199a99f881732758199d8e6d0349bdb28/src/main/java/com/fasterxml/jackson/core/util/BufferRecycler.java#L96

@MichalFoksa
Copy link
Contributor

@franz1981
:( I can't help speed up your issue - I just happened to be the last committer to the main branch. I don’t have any "displacement" in this project.

However, I think closing JsonGenerator could also be useful in:

  • org.apache.avro.Protocol#toString(boolean)
  • org.apache.avro.Protocol.Message#toString

@franz1981
Copy link
Contributor Author

do you know @MichalFoksa who I can ping for this?
as said, this is a severe performance issue which can be fixed with a one-liner...

@MichalFoksa
Copy link
Contributor

MichalFoksa commented Feb 26, 2025 via email

@Fokko Fokko merged commit 254f401 into apache:main Feb 26, 2025
8 checks passed
@Fokko
Copy link
Contributor

Fokko commented Feb 26, 2025

This is great @franz1981 thanks for making this change! And thanks @MichalFoksa for pinging me 🙌

@franz1981
Copy link
Contributor Author

Thanks both folks and let me know if you need the follow up others suggested by @MichalFoksa

opwvhk pushed a commit to opwvhk/avro that referenced this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java Pull Requests for Java binding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants