If I run a function in Python 3 (func()
) is it possible that objects that are created inside func()
but cannot be accessed after it has finished would cause it to increase its memory usage?
For instance, will running
def func():
# Objects being created, that are not able to be used after function call has ended.
while True:
func()
ever cause the program run out of memory, no matter what is in func()
?
If the program is continually using memory, what are some possible things that could be going on in func()
to cause it to continue using memory after it has been called?
Edit: I'm only asking about creating objects that can no longer be accessed after the function has ended, so they should be deleted.