Memory Management in Python - PowerPoint PPT Presentation

About This Presentation
Title:

Memory Management in Python

Description:

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

Number of Views:47
Slides: 9
Provided by: Learnbay.Datascience
Category: Other

less

Transcript and Presenter's Notes

Title: Memory Management in Python


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 heap64 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 Works on same heap
Raw Memory Allocator
Handle the peculiarities of memory management po
lices
adopted by different objects in python.
OS
PVM - Python Virtual Machine
5
Fig-2
  • RAM
  • f1 .py paint OS
  • Code Area
  • Variable area
  • Heap area
  • Free area
  • 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
Write a Comment
User Comments (0)
About PowerShow.com