Skip to content

Commit

Permalink
[SPARK-7100][MLLib] Fix persisted RDD leak in GradientBoostTrees
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Carroll committed Apr 27, 2015
1 parent a7d65d3 commit 45f4b03
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ object GradientBoostedTrees extends Logging {
treeStrategy.assertValid()

// Cache input
if (input.getStorageLevel == StorageLevel.NONE) {
val persistedInput = if (input.getStorageLevel == StorageLevel.NONE) {
input.persist(StorageLevel.MEMORY_AND_DISK)
}
true
} else false

timer.stop("init")

Expand Down Expand Up @@ -265,6 +266,9 @@ object GradientBoostedTrees extends Logging {

logInfo("Internal timing for DecisionTree:")
logInfo(s"$timer")

if (persistedInput) input.unpersist()

if (validate) {
new GradientBoostedTreesModel(
boostingStrategy.treeStrategy.algo,
Expand Down

0 comments on commit 45f4b03

Please sign in to comment.