(original) (raw)
On Tue, Sep 3, 2013 at 7:27 PM, Victor Stinner <victor.stinner@gmail.com> wrote:
API
\===
To trace the most Python memory allocations, the module should be
enabled as early as possible in your application by calling
\`\`tracemalloc.enable()\`\` function, by setting the \`\`PYTHONTRACEMALLOC\`\`
environment variable to \`\`1\`\`, or by using \`\`-X tracemalloc\`\` command
line option.
Functions
\---------
\`\`enable()\`\` function:
Start tracing Python memory allocations.
\`\`disable()\`\` function:
Stop tracing Python memory allocations and stop the timer started by
\`\`start\_timer()\`\`.
\`\`is\_enabled()\`\` function:
Get the status of the module: \`\`True\`\` if it is enabled, \`\`False\`\`
otherwise.
Please mention that this API is similar to that of faulthandler and add a link to faulthandler docs.