TalkPython - Python Memory Management and Tips Course

TalkPython - Python Memory Management and Tips Course

Register & Get access to index

Course Summary​

Python memory management is often a black box to most developers. You probably know that Python uses reference counting, but how can you write code most efficiently to work with it? Did you know it also uses garbage collection? Do you know when that kicks it and its performance implications? With this course, you'll learn all of these concepts and more. You will explore them with concrete code examples, not just theories. And you will learn to optimize your code to both use less memory and to run faster.

What's this course about and how is it different?​

This very unique course will teach not just how Python memory management works and how to create code that functions well within that world, it will provide many concrete techniques, tools, design patterns, and more to make your programs more memory efficient and computationally faster to boot.

If Python memory (allocations, clean up, and so on) has always felt like a weird black box that you have had to take for granted, join this course and open that box. There are many beautiful and interesting aspects of Python's runtime behavior making your code run. You should understand what's happening on your behalf.

What topics are covered​

In this course, you will:

  • Learn how Python variables and data structures actually look in the CPython layer
  • See how the small object allocator treats most objects differently than your intuition
  • Understand Python's memory allocation primitives: blocks, pools, and arenas
  • Locate the elements on C code responsible for Python memory behavior
  • See reference counting in action with live code explorations
  • Discover why reference counting alone is not enough for memory cleanup
  • Work with Python's GC and see when it's needed, and when it's not
  • Compare different data structures to get a sense of their relative size
  • Use multiple clever but simple techniques to massively reduce memory during function calls
  • Lighten up your classes with properties
  • Leverage multiple memory profilers to investigate memory usage line by line and over time
  • And lots more

Who is this course for?​

This course is for anyone who wants to understand how Python memory is managed and make their code more efficient and faster. If you're tired of Python memory being a black box hiding its behavior, turn on the light with this course.

The student requirements are quite light for this course. You'll need Basic Python language knowledge:

  • Classes
  • Functions
  • Properties
  • Variables
  • Loops
  • Iteration
Note: All software used during this course, including editors, Python language, etc., are 100% free and open source. You won't have to buy anything to take the course.

Concepts backed by concise visuals​

While exploring a topic interactively with demos and live code is very engaging, it can mean losing the forest for the trees. That's why when we hit a new topic, we stop and discuss it with concise and clear visuals.

Here's an example of understanding the generational garbage collector and how objects migrate through the generations.

Example: Concepts backed by concise visuals

Get hands-on for almost every chapter​

Things often get too abstract when talking about memory management and related concepts. In this course, we'll develop a lot of code demonstrating most of the features and functionality we discuss.

You'll have access to all the source code at where you can explore and tweak things to see how they run and change behavior.

This course is delivered in very high resolution​


This course is delivered in 1440p (4x the pixel count compared to 720p). That means when you are watching the videos for this course, it looks like you are really sitting next to the instructor looking at their screen.

Every little detail, menu item, and icon is clear and crisp. You can watch the introductory video at the top of this page to see an example.

Follow along with subtitles and transcripts​

Each course comes with subtitles and full transcripts. The transcripts are available as a separate searchable page for each lecture. They also are available in course-wide search results to help you find just the right lecture.

Each course has subtitles available in the video player.
First release
Last update
0.00 star(s) 0 ratings

More resources from TUTProfessor