nswamy commented on issue #14372: [WIP] Memory fixes. Resolves #10867, and resolves #14080 URL: https://github.com/apache/incubator-mxnet/pull/14372#issuecomment-471672568 @andrewfayres, thanks for taking care of this, Its a really nice find :) I find the design of executor less than desirable(where it creates states in a method dynamically) after the the object is created. Anyway, here is what we discussed offline: * `moveToScopeOf` needs cognizant use of it after the creation of the resources * calling `moveToScopeOf` on a large amount of objects will have performance impact. My suggestion is to create a couple methods in ResourceScope. ResourceScope.setScope(scope: ResourceScope) ResourceScope.resetScope() We can document these methods to be used when you want to hold NativeResources as state variables inside another NativeResource, in this case the Executor. ~~Explore to automatically detect(possibly reflection) creation of NativeResource within another NativeResource. Ideal would have been to pass the scope in which to create to a native resource, unfortunately that would require changing every API of NDArray, Symbol, etc., since most of them are exposed as static methods.~~ I am open to hear any other interesting ideas that is less intrusive.
---------------------------------------------------------------- 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
