3 ms·
Check out this SO thread: http://stackoverflow.com/questions/2017381/is-it-possible-to-have-an-actual-memory-leak-in-python-because-of-your-code http://stackove
by bbernard 10y ago
Check out this SO thread: http://stackoverflow.com/questions/2017381/is-it-possible-to-have-an-actual-memory-leak-in-python-because-of-your-code http://stackoverflow.com/questions/2017381/is-it-possible-to....
There are indeed many interpretations of what a memory leak is in Python.
In C/C++, you can forget to free memory, thus causing memory leaks. For example, you may call malloc(), but forget to call free(). In Python or Java, you can't do that; you don't need to explicitly "free" objects, as there's a GC.
Sure, you could leave rogue Python or Java objects in memory, but in my mind this isn't a "leak" in the same sense as a leak in C/C++. The Python interpreter (which is written in C) or some C extension may themselves cause real leaks, though.
I'm the author of the post. Maybe my reasoning was not explained clearly enough.