Fix an embedded runtime memory leak in Java7ClassValue#3228
Merged
headius merged 1 commit intojruby:masterfrom Aug 29, 2015
Merged
Fix an embedded runtime memory leak in Java7ClassValue#3228headius merged 1 commit intojruby:masterfrom
headius merged 1 commit intojruby:masterfrom
Conversation
Commit 09f15f9 enabled the Java7ClassValue implementation by default which exposed a runtime memory leak in the embedded use case. This fixes that leak by wrapping values stored in the java.lang.ClassValue instance with a WeakReference.
Member
|
Related screenshot: https://dl.dropboxusercontent.com/u/9213410/class-values-leak.png I've posted a question to the mlvm-dev list asking whether this rooting is expected. I was under the impression that when the ClassValue goes away, the value it references should be dereferenced, as in ThreadLocal. |
Contributor
Author
|
For reference, I'm seeing this leak when using: |
Contributor
Author
|
Even if this turns out to be a bug upstream in Java and it gets fixed, we'll still need to disable the usage of Java7ClassValue by default and/or apply this patch. Otherwise we're enabling an embedded runtime memory leak by default. |
Member
|
Will just disable to use of ClassValue for now, pending a fix from OpenJDK folks. |
headius
added a commit
that referenced
this pull request
Aug 29, 2015
headius
added a commit
that referenced
this pull request
Aug 29, 2015
Fix an embedded runtime memory leak in Java7ClassValue
headius
added a commit
that referenced
this pull request
Aug 29, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit 09f15f9 enabled the
Java7ClassValue implementation by default which exposed a runtime
memory leak in the embedded use case. This fixes that leak by wrapping
values stored in the java.lang.ClassValue instance with a
WeakReference.