1 / 8

Memory Management in Python

This presentation will educate you about Memory Management in Python with complete diagram and Implementation of Python.

Download Presentation

Memory Management in Python

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Memory Management in Python Swipe

  2. Memory Management in Python Blocks of memory are managed by the Python memory manager. The "Pool" is made up of a group of identical blocks. Arenas create pools, which are 256kB memory chunks allocated to heap=64 pools. If the objects are destroyed, the memory manager creates a new object of the same size to take their place. Allocating a block of memory in a computer to a programme is known as memory allocation. Python's memory allocation and deallocation methods are fully automated, thanks to the Python developers' creation of a garbage collector that eliminates the need for manual garbage collection.

  3. Memory Management in Python Python manages memory with dynamic typing and a combination of reference counting and a cycle-detecting garbage collector. It also has late binding (dynamic name resolution), which binds method and variable names during programme execution. As we all know, whenever we run an application, it is loaded into RAM and the OS allocates some memory to it. The same is depicted in Fig-1. Now, Fig-2 shows the different area created in the allocated memory for running the application.

  4. Fig-1 Raw memory allocator Lowest level memory manager in Python. Interacts with memory manager of OS. Makes sure that enough space is available in private heap to store python related data. PVM Object specific allocator Object specific allocator Object specific allocator Raw Memory Allocator Works on same heap Handle the memory adopted by different objects in python. PVM - Python Virtual Machine peculiarities management of polices OS

  5. Fig-2 Code Area RAM Variable area Heap area f1 .py Free area paint OS Stack area

  6. Memory Management in Python Code Area:- This area is fixed in size, and code is loaded here. Stack Area:- It has the ability to grow and shrink dynamically, and it determines the order in which methods are resolved. Heap Area:- Here object get stored in random order. Variable area:- In this section variables are stored and they refer their corresponding object in heap area.

  7. Implementation of Python Most common implementation of python are available:- Cpython Jython PyPI Ruby Python Stackless Python Anaconda Python

  8. Topics for next Post Components of python program Data Types in Python Mutable vs Immutable Data type in Python Stay Tuned with

More Related