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
How does lambda function differ from a normal function in python?
How to open a text file and display its contents?
What is a for loop in python?
Why do u want this job?
Is python faster than python2?
What is wrong with the code?
How is fail over mechanism works in python?
What is GIL? What does it do?Talk to me about the GIL. How does it impact concurrency in Python? What kinds of applications does it impact more than others?
How to install a package and import?
What is argument in a function?
How to convert a list into a string?
When would you use a break statement in a for loop?
Can you sort a string in python?
How will you merge two dictionaries in python?
How do you write code in python?