By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,010 Members | 2,774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,010 IT Pros & Developers. It's quick & easy.

Whenever you exit Python, is all memory de-allocated?

P: 6
Whenever I exit Python, is all memory de-allocated?
Feb 27 '19 #1
Share this Question
Share on Google+
3 Replies


dev7060
100+
P: 117
I am not sure in case of Python, but in general, all major operating systems will free the memory upon the termination of process.

Are you referring to the memory that is being dynamically allocated? In C/C++, we use free() function to release the dynamically allocated space (since it doesn't get freed on its own).

Hope that helps
Feb 28 '19 #2

P: 9
The answer here is no. The modules with circular references to other objects, or to objects referenced from global namespaces, arenít always freed on exiting Python.

Plus, it is impossible to de-allocate portions of memory reserved by the C library.
Mar 1 '19 #3

P: 5
Whenever Python exists, especially those Python modules which are having circular references to other objects or the objects that are referenced from the global namespaces are not always de-allocated or freed.
It is impossible to de-allocate those portions of memory that are reserved by the C library.
On exit, because of having its own efficient cleanup mechanism, Python would try to de-allocate/destroy every other object.
So, if you want to improve your skills in python in detailed, you can join the best python training institute in Noida which will help you enhance your skills and earn huge profits later.
Mar 4 '19 #4

Post your reply

Sign in to post your reply or Sign up for a free account.