Python for the .NET developer Transcripts
Chapter: Memory management in Python
Lecture: Introduction to memory management

Login or purchase this course to watch this video and the rest of the course contents.
0:00 In this chapter we're going to talk
0:01 about memory management in Python.
0:04 Both Python and C# basically take care of memory for us.
0:08 So, why should we even talk about it?
0:10 Well, on one hand, you can just ignore it, right?
0:13 Just create your objects, and call functions
0:15 and magically things are handled.
0:18 However, understanding how memory works
0:20 gives us a better intuition of how
0:22 our code executes, how performance works
0:25 all sorts of things like that.
0:27 You probably have a fairly good
0:29 understanding of C#'s memory management
0:31 its garbage collector. We're going
0:33 to talk about Python's as well.
0:36 Now, for some reason, talking about memory
0:38 management in Python is not nearly
0:40 as popular or as big of a talking point
0:43 as it is in C#. There's a ton of
0:45 analysis of garbage collectors and
0:47 algorithms and all sorts of stuff.
0:49 In Python there's not too much.
0:51 So, what I'm going to do is I'm going
0:52 to give you a little bit of insight
0:54 into how Python manages memory
0:56 so you'll have a good working model of what's
0:59 happening when you write your code
1:00 and how it's taking care of memory for us.
1:02 But like I said, in both of these languages
1:04 you don't have to actively do too much
1:06 to make the memory management work
1:09 but it's a really good idea to have
1:10 an understanding of how it's being done for you.