Does Python do any analysis to free memory earlier? For example, if I have:
d = some big array
# ... use(d) ...
# no d is used from here
# a lot of other code, the code could use more big arrays
When does python decide to delete the memory used by d
?
If I use d
in a function, will d
be freed when the function is done?
Maybe in general this is hard, because d
can be assigned to others, and they may continue using d
after the function is finished.
However, I was looking for some good practice that can keep python use less memory...