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

Improve deallocation of direct ByteBuffers using sun.misc.Unsafe? #10

Open
cowtowncoder opened this issue Dec 10, 2011 · 0 comments
Open

Comments

@cowtowncoder
Copy link
Owner

Apparently deallocation of direct-allocated ByteBuffers is bit tricky, since underlying off-heap buffers are NOT necessarily freed in timely manner, partly since there is no mechanism to force deallocation. As such they might only be collected when GC kicks in.

However there is apparently a way to force freeing using sun.misc.Unsafe. If so, we should probably try to use that mechanism to reduce likelihood of OOMEs caused by delayed deallocation.

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

1 participant