-
Notifications
You must be signed in to change notification settings - Fork 41k
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
ZipInflaterInputStream native memory leak #13935
Comments
Can you provide a few more details please. It's not clear to me why the |
In ZipInflaterInputStream constructor function, we should set usesDefaultInflater = true; native memory can be freed when close is called. wo should not depend on gc. native memory is hard to release , because Inflater enter old generation. |
We can't set
The GC generation of the object should not make any difference. AFAIK, its memory (and any associated native memory) will be freed when it is eligible for garbage collection. Rather than describing a theoretical problem, perhaps you can provide a small sample that shows a failure due to memory being leaked? |
I guess @zhujibing tried to say a general rule that releasing resources explicitly whenever possible is better than resorting to GC, so I just created #14001 to resolve the concern. |
Closing in favour of #14001. |
* pr/14001: Invoke Inflater.end() in ZipInflaterInputStream.close()
ZipInflaterInputStream
constructor function will create Inflater object where use native memory,but Memory is not freed。The text was updated successfully, but these errors were encountered: