{
    "mode": "pydoc",
    "parameter": "_tracemalloc",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/_tracemalloc/json",
    "generated": "2026-06-02T13:19:44Z",
    "sections": {
        "NAME": {
            "content": "tracemalloc - Debug module to trace memory blocks allocated by Python.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "clear_traces",
                    "content": "Clear traces of memory blocks allocated by Python.\n"
                },
                {
                    "name": "get_traceback_limit",
                    "content": "Get the maximum number of frames stored in the traceback of a trace.\n\nBy default, a trace of an allocated memory block only stores\nthe most recent frame: the limit is 1.\n"
                },
                {
                    "name": "get_traced_memory",
                    "content": "Get the current size and peak size of memory blocks traced by tracemalloc.\n\nReturns a tuple: (current: int, peak: int).\n"
                },
                {
                    "name": "get_tracemalloc_memory",
                    "content": "Get the memory usage in bytes of the tracemalloc module.\n\nThis memory is used internally to trace memory allocations.\n"
                },
                {
                    "name": "is_tracing",
                    "content": "Return True if the tracemalloc module is tracing Python memory allocations.\n"
                },
                {
                    "name": "reset_peak",
                    "content": "Set the peak size of memory blocks traced by tracemalloc to the current size.\n\nDo nothing if the tracemalloc module is not tracing memory allocations.\n"
                },
                {
                    "name": "start",
                    "content": "Start tracing Python memory allocations.\n\nAlso set the maximum number of frames stored in the traceback of a\ntrace to nframe.\n"
                },
                {
                    "name": "stop",
                    "content": "Stop tracing Python memory allocations.\n\nAlso clear traces of memory blocks allocated by Python.\n"
                }
            ]
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "tracemalloc - Debug module to trace memory blocks allocated by Python.",
    "flags": [],
    "examples": [],
    "see_also": []
}