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/06/29 06:23:57 UTC

[GitHub] yzhliu commented on a change in pull request #11408: [MXNET-600][WIP] Memory leak fix in the Scala training

yzhliu commented on a change in pull request #11408: [MXNET-600][WIP] Memory leak fix in the Scala training
URL: https://github.com/apache/incubator-mxnet/pull/11408#discussion_r199061692
 
 

 ##########
 File path: scala-package/core/src/main/scala/org/apache/mxnet/FeedForward.scala
 ##########
 @@ -146,20 +146,21 @@ class FeedForward private(
 
     for ((k, v) <- argParams) {
       if (_argParams != null && _argParams.contains(k) && (!overwrite)) {
-        argParams(k).set(_argParams(k))
+        v.set(_argParams(k))
+        _argParams(k).dispose()
 
 Review comment:
   not 100% safe to dispose ndarrays in `_argParams`. `_argParams` was initialized by user: https://github.com/apache/incubator-mxnet/blob/master/scala-package/core/src/main/scala/org/apache/mxnet/FeedForward.scala#L62-L63
   User may use it later.

----------------------------------------------------------------
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