Answer Posted / chaitanya
Memory management in Python involves a private heap containing all Python objects and data structures. Interpreter takes care of Python heap and that the programmer has no access to it.
The allocation of heap space for Python objects is done by Python memory manager. The core API of Python provides some tools for the programmer to code reliable and more robust program.
Python also has a build-in garbage collector which recycles all the unused memory. When an object is no longer referenced by the program, the heap space it occupies can be freed. The garbage collector determines objects which are no longer referenced by the sprogram frees the occupied memory and make it available to the heap space.
The gc module defines functions to enable /disable garbage collector:
gc.enable() -Enables automatic garbage collection.
gc.disable() - Disables automatic garbage collection.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is monkey Patching in python?
What is anagram in python?
How to redirect stdout to a file in python?
How do you convert a string to in python?
How do you install a sphinx python?
What is the python keyword "with" used for?
How to copy an object in python?
Why isn't there a switch or case statement in python?
Is python a shell?
How will you find, in a string, the first word that rhymes with ‘cake’?
What does serialization mean in python?
What is r regex?
Is set nesting implemented in python?
Tell me how memcached should not be used in your python project?
How will you remove an object from a list?