-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-12961][Core] Prevent snappy-java memory leak #10875
Conversation
Test build #49901 has finished for PR 10875 at commit
|
Seems fine |
@@ -149,12 +149,7 @@ class LZFCompressionCodec(conf: SparkConf) extends CompressionCodec { | |||
*/ | |||
@DeveloperApi | |||
class SnappyCompressionCodec(conf: SparkConf) extends CompressionCodec { | |||
|
|||
try { | |||
Snappy.getNativeLibraryVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added by @ksakellis in #3119; the original motivation related to error reporting. I suppose there's a chance that the change in this patch changes that behavior slightly, but that might not be a huge deal. Let's see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I guess getNativeLibraryVersion
might be kind of expensive due to the IO that it does, so maybe calling it less frequently will give us a perf. boost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think so.
@JoshRosen @srowen Is this ready to merge? |
Merged to master/1.6 |
JIRA: https://issues.apache.org/jira/browse/SPARK-12961 To prevent memory leak in snappy-java, just call the method once and cache the result. After the library releases new version, we can remove this object. JoshRosen Author: Liang-Chi Hsieh <viirya@gmail.com> Closes #10875 from viirya/prevent-snappy-memory-leak. (cherry picked from commit 5936bf9) Signed-off-by: Sean Owen <sowen@cloudera.com>
JIRA: https://issues.apache.org/jira/browse/SPARK-12961
To prevent memory leak in snappy-java, just call the method once and cache the result. After the library releases new version, we can remove this object.
@JoshRosen