Skip to content
Snippets Groups Projects
Commit 31da40df authored by Tim Ellison's avatar Tim Ellison Committed by Andrew Or
Browse files

[MINOR] Defeat early garbage collection of test suite variable

The JVM is free to collect references to variables that no longer participate in a computation.  This simple patch adds an operation to the variable 'rdd' to ensure it is not collected early in the test suite's explicit calls to GC.

ref: http://bugs.java.com/view_bug.do?bug_id=6721588

Author: Tim Ellison <t.p.ellison@gmail.com>

Closes #6010 from tellison/master and squashes the following commits:

77d1c8f [Tim Ellison] Defeat early garbage collection of test suite variable by aggressive JVMs
parent 4e7360e1
No related branches found
No related tags found
No related merge requests found
......@@ -183,6 +183,7 @@ class ContextCleanerSuite extends ContextCleanerSuiteBase {
}
// Test that GC causes shuffle cleanup after dereferencing the RDD
rdd.count() // Defeat any early collection of rdd variable by the JVM
val postGCTester = new CleanerTester(sc, shuffleIds = Seq(0))
rdd = null // Make RDD out of scope, so that corresponding shuffle goes out of scope
runGC()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment