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

Pull request for solving issue #400 #450

Closed
wants to merge 13 commits into from
Closed

Conversation

jborgers
Copy link

@jborgers jborgers commented Apr 4, 2018

Pull request for solving issue #400: BufferRecyclers are not released on shutdown of the application.

Can't automatically merge. This fork started in Sep 2017 so behind of base fork.

…ocals after application shutdown. Keeps a list of softly referenced BufferRecyclers and weakly references from ThreadLocals.
…antially with every SoftReferences clearing by gc, a small leak. Solved by using a ReferenceQueue. Additionally added more doc.
…d from ThreadLocals, to a Set referencing the SoftRefs referenced from ThreadLocals. This saves the WeakRefs, less complex, and the set provides faster, O(1) add and remove operations. Shutdown iterates and clears the Set, soguarded by a lock.
… by a feature and static method.

Factored out new machinery into separate class, only instantiated if enabled.
… to be unmanagable.

It can now only be enabled during classloading with system property
com.fasterxml.jackson.core.use_releasable_thread_local_buffers=true
# Conflicts:
#	src/main/java/com/fasterxml/jackson/core/JsonFactory.java
Added releaseBuffers method, called from shutdown.
Improved javadoc.
@cowtowncoder
Copy link
Member

@jborgers Looks good: I will refactor bits and pieces but that should be easy enough. Just need bit of uninterrupted time to piece it together, and can perhaps do some performance testing for fun too.

@cowtowncoder
Copy link
Member

Thank you again -- ended up integrated manually, so closing this PR.

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

Successfully merging this pull request may close these issues.

3 participants