Skip to content

Commit

Permalink
[MINOR] Defeat early garbage collection of test suite variable
Browse files Browse the repository at this point in the history
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 <[email protected]>

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

77d1c8f [Tim Ellison] Defeat early garbage collection of test suite variable by aggressive JVMs
  • Loading branch information
tellison authored and jeanlyn committed Jun 12, 2015
1 parent efdf50e commit 985a43d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 985a43d

Please sign in to comment.