You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/22 01:18:30 UTC

[GitHub] yzhliu commented on a change in pull request #12232: [MXNET-729] Scala Examples memory leak fix

yzhliu commented on a change in pull request #12232: [MXNET-729] Scala Examples memory leak fix
URL: https://github.com/apache/incubator-mxnet/pull/12232#discussion_r211805605
 
 

 ##########
 File path: scala-package/examples/src/test/scala/org/apache/mxnetexamples/rnn/ExampleRNNSuite.scala
 ##########
 @@ -50,26 +49,32 @@ class ExampleRNNSuite extends FunSuite with BeforeAndAfterAll {
       System.getenv("SCALA_TEST_ON_GPU").toInt == 1) {
       ctx = Context.gpu()
     }
-    LstmBucketing.runTraining(tempDirPath + "/RNN/sherlockholmes.train.txt",
+    NDArrayCollector.auto().withScope {
+      LstmBucketing.runTraining(tempDirPath + "/RNN/sherlockholmes.train.txt",
 
 Review comment:
   it is better to have the collector inside `runTraining`, like that you do in GanMnist.scala. Otherwise when the # of loop increases, too many ndarrays will be stored temporarily in the collector here.
   But if you just mean to get rid of mem leak in CI, then this is fine.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services