anirudh2290 commented on issue #15375: Memory leak in Naive engine when 
profiling
URL: 
https://github.com/apache/incubator-mxnet/issues/15375#issuecomment-506851797
 
 
   @larroy even less encouraging is having you make a PR and then blocking it. 
I was trying to save you some time. Ownership of the pointer rests with the 
module that pushes it. So imperative or graph executor should handle it. If you 
are really keen on doing this do it in the graph executor. There is no need to 
touch the engine code here.
   
   > Having a pointer released in a call hierarchy 3 levels down leads to bugs 
and memory leaks, is difficult to reason about it. 
   
   This is the design, Engine relies on object pool for allocation, and the 
modules depend on engine to handle this, the modules just tell them when it 
wants a new operator creator or destroyed.
   I think the code is very logical and it makes sense to me. Also, the memory 
leak you found is nowhere related to the ThreadedEngine code.
   
   I considered the benefits of your approach: "readability/understandability" 
in the first comment.
   
   

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