tqchen commented on issue #264: URL: https://github.com/apache/tvm-ffi/issues/264#issuecomment-3543716497
Coming back two high-level pictures, there are three kinds of dlls. - L0: mylib_L0.so, which gets linked during compile time - L1: mylib_L1.so, can link to some mylib_L0.so, loaded via load_module and kept alive globally, this is how most python extension works. the way is to keep them in python or cython, so they can be kept alive during unloading. - L2: temp lived mylib_L2.so can link to some mylib_L0.so Usually if allocation happens in mylib_L0/mylib_L1, there will be no issue because the OS ensures it gets unloaded after the libraries we depend on get unloaded. This is also why ctypes.CDLL never unloads the lib. The main issue is `mylib_L2.so` that we are seeing today, one possible approach is we give options to long lived loading. But short loading is also useful for cases like JIT compile where we do expect to reclaim resources early -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
