When i run a mojo program that uses Python objects like
var sklearn = Python.import_module("sklearn.datasets")
using build -sanitize address i get a lot of indirect leak memory warnings by the mojo compiler. Is there a way to release the allocated memory for these python object manually?
So far, doing this does not seems to work: sklearn = None
You might also try explicitly discarding the value with _ = sklearn^
I don’t think that’s going to work any differently than sklearn = None, but it’s worth ruling out. Other possibilities: accidental copying of the python object (for example, by passing it into an owned argument), or holding on to some value from sklearn.datasets that’s causing either Python or Mojo to retain the memory.