From the course: Programming Foundations: Memory, Pointers, and Garbage Collection

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Memory management in Python

Memory management in Python

- [Narrator] Python is a very popular language amongst beginning programmers, well, not only amongst beginners. It has a beautiful, clean syntax, but one of the reasons for this popularity is that it helps with both memory management and that it's dynamically typed. Well, what do I mean with dynamically typed? In Python, when you create a variable, you don't need to tell Python what type the variable will have, Python will figure it out for you. How Python manages the memory exactly? Depends on the Python implementation that you're using. CPython is by far the most popular implementation, so let's dive into how it's done for CPython. Since CPython is written in C, this story might sound familiar but it's going to be a bit more detailed. When we run a Python program, we do so in a designated area of the RAM. Our computer is using the RAM memory to run more applications than just our Python program though. So only…

Contents