Navigation

  • index
  • next |
  • previous |
  • Python Extension Patterns 0.3.0 documentation »
  • 21. Memory Leaks

21. Memory Leaks¶

This chapter describes some techniques for detecting and fixing memory leaks. Much of this is taken from the pymemtrace project

  • 21.1. Introduction
    • 21.1.1. Is it a Leak?
    • 21.1.2. Sources of Leaks
    • 21.1.3. A Bit About (C)Python Memory Management
      • 21.1.3.1. Reference Counts
      • 21.1.3.2. Garbage Collection
      • 21.1.3.3. The Big Picture
      • 21.1.3.4. CPython’s Object Allocator (pymalloc)
  • 21.2. Tools for Detecting Memory Leaks
    • 21.2.1. Platform Tools
      • 21.2.1.1. Windows
      • 21.2.1.2. Linux
      • 21.2.1.3. Mac OS X
    • 21.2.2. Python Tools
      • 21.2.2.1. Modules from the Standard Library
      • 21.2.2.2. Third Party Modules
    • 21.2.3. Debugging Tools
    • 21.2.4. Building a Debug Version of Python
  • 21.3. Techniques
    • 21.3.1. High Level
      • 21.3.1.1. Using Platform Tools
      • 21.3.1.2. Specific Tricks
  • 21.4. pymemtrace
    • 21.4.1. pymemtrace Tools
    • 21.4.2. Tool Characteristics
      • 21.4.2.1. Licence
      • 21.4.2.2. Credits
    • 21.4.3. pymemtrace Process
    • 21.4.4. pymemtrace cPyMemTrace
      • 21.4.4.1. Logging Changes in RSS
      • 21.4.4.2. Logging Every Event
    • 21.4.5. pymemtrace and DTrace
    • 21.4.6. pymemtrace trace_malloc
      • 21.4.6.1. Using trace_malloc Directly
      • 21.4.6.2. Using trace_malloc as a Decorator
    • 21.4.7. pymemtrace Debug Malloc Stats

Previous topic

20.8. Instrumenting the Python Process for Your Structures

Next topic

21.1. Introduction

This Page

  • Show Source

Quick search

Navigation

  • index
  • next |
  • previous |
  • Python Extension Patterns 0.3.0 documentation »
  • 21. Memory Leaks
© Copyright 2014-2025, Paul Ross <apaulross@gmail.com> All rights reserved.. Created using Sphinx 8.2.3.