I have hundreds of really larges matrices, like (600, 800) or (3, 600, 800) shape'd ones.
Therefore I want to de-allocate the memory used as soon as I don't really need something anymore.
I thought:
some_matrix = None
Should do the job, or is just the reference set to None but somewhere in the Memory the space still allocated? (like preserving the allocated space for some re-initialization of some_matrix
in the future)
Additionally: sometimes I am slicing through the matrices, calculated something and put the values into a buffer (a list, because it gets appended all the time). So setting a list to None will definitely free the memory, right?
Or does some kind of unset()
method exist where whole identifiers plus its referenced objects are "deleted"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…