access2rohit commented on a change in pull request #14365: Fix memory leak for 
size-zero ndarray
URL: https://github.com/apache/incubator-mxnet/pull/14365#discussion_r264837342
 
 

 ##########
 File path: include/mxnet/ndarray.h
 ##########
 @@ -986,9 +986,8 @@ class NDArray {
 #endif
         delay_alloc = false;
       } else if (shandle.size < dbytes) {
-        // free storage if necessary and alloc again
-        if (shandle.size > 0) Storage::Get()->Free(shandle);
-        // init storage
 
 Review comment:
   Ohh ... sorry if I wasn't clear. I meant that in the previous version of 
code there waas this comment line:
   // init aux storage
   before
   shandle = Storage::Get()->Alloc(dbytes, shandle.ctx);
    which got deleted in your commit. Suggesting that it would be good idea to 
add it back. Earlier comment already mentioned "// free storage if necessary 
and alloc again" and still used "// init storage". Anyways its not that big a 
deal. Current comment still looks reasonable.
   

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

Reply via email to