From 4ad38360290d59fdf25a009bc65823553cea9b10 Mon Sep 17 00:00:00 2001 From: Anthony Truchet Date: Fri, 8 Jul 2016 14:54:24 +0200 Subject: [PATCH] [SPARK-16440][MLlib] Destroy broadcasted variables even on driver This contribution is on done on behalf of Criteo, according to the terms of the Apache license. --- .../scala/org/apache/spark/mllib/feature/Word2Vec.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala b/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala index 6b9c8ee2e3efc..bc75646d532dc 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala @@ -434,9 +434,9 @@ class Word2Vec extends Serializable with Logging { bcSyn1Global.unpersist(false) } newSentences.unpersist() - expTable.unpersist() - bcVocab.unpersist() - bcVocabHash.unpersist() + expTable.destroy() + bcVocab.destroy() + bcVocabHash.destroy() val wordArray = vocab.map(_.word) new Word2VecModel(wordArray.zipWithIndex.toMap, syn0Global)