nswamy commented on a change in pull request #14372: Memory fixes. Resolves
#10867, and resolves #14080
URL: https://github.com/apache/incubator-mxnet/pull/14372#discussion_r269739126
##########
File path:
scala-package/core/src/main/scala/org/apache/mxnet/ResourceScope.scala
##########
@@ -48,8 +48,10 @@ class ResourceScope extends AutoCloseable {
*/
override def close(): Unit = {
ResourceScope.removeFromThreadLocal(this)
- resourceQ.foreach(resource => if (resource != null)
resource.dispose(false) )
- resourceQ.clear()
+ if (!ResourceScope.threadLocalScopes.get().contains(this)) {
Review comment:
when would this be true? because we are removing right in the above line
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services