Python Memory Management and Tips Transcripts
Chapter: Investigating memory usage
Lecture: Concept: Line by line memory with memory_profiler
0:00 Let's just review how we did
0:01 line by line profiling with Memory Profiler.
0:04 We started out by finding the function that we want to look at
0:07 that's creating the memory, or causing the memory problem,
0:10 and we put an "@profiler" decorator out of that library on it.
0:14 And then we go and run Python,
0:17 the one out of the Virtue environment,
0:18 -m memory_profiler and then just the script and any arguments that it
0:23 might take. It runs and cranks on that for a while and boom, out comes some
0:28 nice results showing how each line added to, or did not add to, how much memory
0:33 was being used.