René's URL Explorer Experiment


Title: Isolate the tracemalloc Module Between Interpreters · Issue #101520 · python/cpython · GitHub

Open Graph Title: Isolate the tracemalloc Module Between Interpreters · Issue #101520 · python/cpython

X Title: Isolate the tracemalloc Module Between Interpreters · Issue #101520 · python/cpython

Description: (See #100227.) Currently the tracemalloc module has some state in _PyRuntimeState, including objects, which is shared by all interpreters. Interpreters should be isolated from each other, for a variety of reasons (including the possibili...

Open Graph Description: (See #100227.) Currently the tracemalloc module has some state in _PyRuntimeState, including objects, which is shared by all interpreters. Interpreters should be isolated from each other, for a var...

X Description: (See #100227.) Currently the tracemalloc module has some state in _PyRuntimeState, including objects, which is shared by all interpreters. Interpreters should be isolated from each other, for a var...

Opengraph URL: https://github.com/python/cpython/issues/101520

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Isolate the tracemalloc Module Between Interpreters","articleBody":"(See https://github.com/python/cpython/issues/100227.)\r\n\r\nCurrently the tracemalloc module has some state in `_PyRuntimeState`, including objects, which is shared by all interpreters.  Interpreters should be isolated from each other, for a variety of reasons (including the possibility of a per-interpreter GIL).  Isolating the module will involve moving some of the state to `PyInterpreterState` (and, under per-interpreter GIL, guarding other state with a global lock).\r\n\r\n----\r\n\r\nAnalysis:\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e(expand)\u003c/summary\u003e\r\n\r\n## Allocators\r\n\r\nThe module installs a custom allocator (using the PEP 445 API\r\n ([docs](https://docs.python.org/3.12/c-api/memory.html#customize-memory-allocators)).\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e(expand)\u003c/summary\u003e\r\n\r\n\u003cBR/\u003e\r\n\r\nthe allocator functions:\r\n\r\n| domain | func | wraps | wraps (reentrant) | actually wraps |\r\n| ---- | ---- | ---- | ---- | ---- |\r\n| \u003cp align=\"center\"\u003e-\u003c/p\u003e | `tracemalloc_alloc()` | \\\u003coriginal `malloc()` or `calloc()`\\\u003e | \\\u003c--- |  |\r\n| \u003cp align=\"center\"\u003e-\u003c/p\u003e | `tracemalloc_realloc()` | \\\u003coriginal `realloc()` or `free()`\\\u003e | \\\u003c--- |  |\r\n| \u003cp align=\"center\"\u003e-\u003c/p\u003e | `tracemalloc_raw_alloc()` | `tracemalloc_alloc()` **\\*** | \\\u003coriginal `malloc()` or `calloc()`\\\u003e |  |\r\n| \u003cp align=\"center\"\u003e-\u003c/p\u003e | `tracemalloc_alloc_gil()` | `tracemalloc_alloc()` | \\\u003coriginal `malloc()` or `calloc()`\\\u003e |  |\r\n| raw |  |  |  |  |\r\n|  | `tracemalloc_raw_malloc()` | `tracemalloc_alloc()` | \u003coriginal `malloc()`\u003e | `tracemalloc_raw_alloc()` |\r\n|  | `tracemalloc_raw_calloc()` | `tracemalloc_alloc()` | \u003coriginal `calloc()`\u003e | `tracemalloc_raw_alloc()` |\r\n|  | `tracemalloc_raw_realloc()` | `tracemalloc_realloc()` **\\*** | \\\u003coriginal `realloc()`\u003e |  |\r\n|  | `tracemalloc_free()` | \u003coriginal `free()`\u003e | \\\u003c--- |  |\r\n| mem |  |  |  |  |\r\n| obj |  |  |  |  |\r\n|  | `tracemalloc_malloc_gil()` | `tracemalloc_alloc_gil()` | \\\u003c--- |  |\r\n|  | `tracemalloc_calloc_gil()` | `tracemalloc_alloc_gil()` | \\\u003c--- |  |\r\n|  | `tracemalloc_realloc_gil()` | `tracemalloc_realloc()` | \\\u003coriginal `realloc()`\\\u003e |  |\r\n|  | `tracemalloc_free()` | \u003coriginal `free()`\u003e | \\\u003c--- |  |\r\n\r\n**\\*** Note that `tracemalloc_raw_alloc()` wraps the `tracemalloc_alloc()` call\r\nwith `PyGILState_Ensure()`/`PyGILState_Release()`.\r\nLikewise for `tracemalloc_raw_realloc()` where it calls `tracemalloc_realloc()`.\r\nIn no other case does an allocator function use the GILState API for any calls.\r\n\r\n\u003c/details\u003e\r\n\r\n\r\n## State\r\n\r\n### Fields\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e(expand)\u003c/summary\u003e\r\n\r\n\u003cBR/\u003e\r\n\r\nhttps://github.com/python/cpython/blob/main/Include/internal/pycore_tracemalloc.h#L57-L107\r\nhttps://github.com/python/cpython/blob/main/Include/internal/pycore_runtime.h#L147\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eraw\u003c/summary\u003e\r\n\r\n\u003cBR/\u003e\r\n\r\nhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Include/internal/pycore_tracemalloc.h#L43-L55\r\nhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Include/internal/pycore_tracemalloc.h#L57-L64\r\nhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Include/internal/pycore_tracemalloc.h#L57-L107\r\n\r\nhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Modules/_tracemalloc.c#L54-L55\r\nhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Modules/_tracemalloc.c#L69-L76\r\n\r\n\u003c/details\u003e\r\n\r\n| name | type | protected by | \\#ifdef | notes |\r\n| ---- | ---- | ---- | ---- | ---- |\r\n| `config` | `struct _PyTraceMalloc_Config` |  |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `initialized` | `enum {}` | GIL |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `tracing` | `bool` | GIL |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `max_nframe` | `int` | GIL |  |  |\r\n| `allocators` |  |  |  | see PEP 445 ([docs](https://docs.python.org/3.12/c-api/memory.html#customize-memory-allocators)) |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `mem` | `PyMemAllocatorEx` | GIL |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `raw` | `PyMemAllocatorEx` | GIL |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `obj` | `PyMemAllocatorEx` | GIL |  |  |\r\n| `tables_lock` | `PyThread_type_lock` | GIL | `TRACE_RAW_MALLOC` |  |\r\n| `traced_memory` | `size_t` | `tables_lock` |  |  |\r\n| `peak_traced_memory` | `size_t` | `tables_lock` |  |  |\r\n| `filenames` | `_Py_hashtable_t *` | GIL |  | interned; effectively a `set` of objects |\r\n| `traceback` | `struct tracemalloc_traceback *` | GIL |  | a temporary buffer |\r\n| `tracebacks` | `_Py_hashtable_t *` | GIL |  | interned; effectively a `set` of `traceback_t` |\r\n| `traces` | `_Py_hashtable_t *` | `tables_lock` |  | void-ptr -\u003e `trace_t`  |\r\n| `domains` | `_Py_hashtable_t *` |`tables_lock`  |  | domain -\u003e `_Py_hashtable_t *` (per-domain `traces`) |\r\n| `empty_traceback` | `struct tracemalloc_traceback` | ??? |  |  |\r\n| `reentrant_key` | `Py_tss_t` | ??? |  |  |\r\n\r\nnotes:\r\n* each frame in `struct tracemalloc_traceback` holds a filename object\r\n* `traceback_t` is a typedef for `struct tracemalloc_traceback`\r\n* `frame_t` is a typedef for `struct tracemalloc_frame`\r\n\r\nhold objects:\r\n\r\n* `filenames`\r\n* `traceback` (filename in each frame)\r\n* `tracebacks` (filename in each frame of each traceback)\r\n* `traces` (filename in each frame of each traceback)\r\n* `domains` (filename in each frame of each traceback in each domain)\r\n\r\n\u003c/details\u003e\r\n\r\n\r\n### Usage\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e(expand)\u003c/summary\u003e\r\n\r\n\u003cBR/\u003e\r\n\r\nsimple:\r\n\r\n| name | context | get | set |\r\n| ---- | ---- | ---- | ---- |\r\n| `config` |  |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `initialized` | lifecycle | `tracemalloc_init()`\u003cBR/\u003e`tracemalloc_deinit()` | `tracemalloc_init()`\u003cBR/\u003e`tracemalloc_deinit()` |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `tracing` | module | `_tracemalloc_is_tracing_impl()`\u003cBR/\u003e`_tracemalloc__get_traces_impl()`\u003cBR/\u003e`_tracemalloc_clear_traces_impl()`\u003cBR/\u003e`_tracemalloc_get_traceback_limit_impl()`\u003cBR/\u003e`_tracemalloc_get_traced_memory_impl()`\u003cBR/\u003e`_tracemalloc_reset_peak_impl()` |  |\r\n|  | C-API | `PyTraceMalloc_Track()`\u003cBR/\u003e`PyTraceMalloc_Untrack()`\u003cBR/\u003e`_PyTraceMalloc_NewReference()`\u003cBR/\u003e`_PyMem_DumpTraceback()` |  |\r\n|  | lifecycle | `tracemalloc_start()`\u003cBR/\u003e`tracemalloc_stop()` | `tracemalloc_start()`\u003cBR/\u003e`tracemalloc_stop()` |\r\n|  | internal | `tracemalloc_get_traceback()` |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `max_nframe` | module | `_tracemalloc_get_traceback_limit_impl()` |  |\r\n|  | lifecycle |  | `tracemalloc_start()` |\r\n|  | internal | `traceback_get_frames()` |  |\r\n| `allocators` |  |  |  |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `mem` | lifecycle | `tracemalloc_start()` \\+\u003cBR/\u003e`tracemalloc_stop()` |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `raw` | lifecycle | `tracemalloc_init()` \\+\u003cBR/\u003e`tracemalloc_start()` \\+\u003cBR/\u003e`tracemalloc_stop()` |  |\r\n|  | internal | `raw_malloc()`\u003cBR/\u003e `raw_free()` |  |\r\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;. `obj` | lifecycle | `tracemalloc_start()` \\+\u003cBR/\u003e`tracemalloc_stop()` |  |\r\n| `tables_lock` | module | `_tracemalloc__get_traces_impl()` \\+\u003cBR/\u003e`_tracemalloc_get_tracemalloc_memory_impl()` \\+\u003cBR/\u003e`_tracemalloc_get_traced_memory_impl()` \\+\u003cBR/\u003e`_tracemalloc_reset_peak_impl()` \\+ |  |\r\n|  | C-API | `PyTraceMalloc_Track()` \\+\u003cBR/\u003e`PyTraceMalloc_Untrack()` \\+\u003cBR/\u003e`_PyTraceMalloc_NewReference()` \\+ |  |\r\n|  | lifecycle | `tracemalloc_init()`\u003cBR/\u003e`tracemalloc_deinit()` | `tracemalloc_init()` \\*\u003cBR/\u003e`tracemalloc_deinit()` \\* |\r\n|  | allocator | `tracemalloc_alloc()` \\+\u003cBR/\u003e`tracemalloc_realloc()` \\+\u003cBR/\u003e`tracemalloc_free()` \\+\u003cBR/\u003e`tracemalloc_realloc_gil()` \\+\u003cBR/\u003e`tracemalloc_raw_realloc()` \\+ |  |\r\n|  | internal | `tracemalloc_get_traceback()` \\+\u003cBR/\u003e`tracemalloc_clear_traces()` \\+ |  |\r\n| `traced_memory` | module | `_tracemalloc_get_traced_memory_impl()`\u003cBR/\u003e`_tracemalloc_reset_peak_impl()` |  |\r\n|  | internal | `tracemalloc_add_trace()` | `tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_remove_trace()`\u003cBR/\u003e`tracemalloc_clear_traces()` |\r\n| `peak_traced_memory` | module | `_tracemalloc_get_traced_memory_impl()` | `_tracemalloc_reset_peak_impl()` |\r\n|  | internal | `tracemalloc_add_trace()` | `tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_clear_traces()` |\r\n| `filenames` | module | `_tracemalloc_get_tracemalloc_memory_impl()` |  |\r\n|  | lifecycle |  | `tracemalloc_init()` \\* |\r\n|  | internal | `tracemalloc_get_frame()`\u003cBR/\u003e`tracemalloc_clear_traces()` \\+ |  |\r\n| `traceback` | lifecycle | `tracemalloc_stop()` | `tracemalloc_start()` \\*\u003cBR/\u003e`tracemalloc_stop()` \\* |\r\n|  | internal | `traceback_new()` \\+ |  |\r\n| `tracebacks` | module | `_tracemalloc_get_tracemalloc_memory_impl()` |  |\r\n|  | lifecycle |  | `tracemalloc_init()` \\*\u003cBR/\u003e`tracemalloc_deinit()` \\+ |\r\n|  | internal | `traceback_new()` \\+\u003cBR/\u003e`tracemalloc_clear_traces()` \\+ |  |\r\n| `traces` | module | `_tracemalloc__get_traces_impl()`\u003cBR/\u003e`_tracemalloc_get_tracemalloc_memory_impl()` |  |\r\n|  | C-API | `_PyTraceMalloc_NewReference()` |  |\r\n|  | lifecycle | `tracemalloc_deinit()` \\+ | `tracemalloc_init()` \\* |\r\n|  | internal | `tracemalloc_get_traces_table()`\u003cBR/\u003e`tracemalloc_add_trace()` (indirect)\u003cBR/\u003e`tracemalloc_remove_trace()` (indirect)\u003cBR/\u003e`tracemalloc_get_traceback()` (indirect)\u003cBR/\u003e`tracemalloc_clear_traces()` \\+ |  |\r\n| `domains` | module | `_tracemalloc__get_traces_impl()`\u003cBR/\u003e`_tracemalloc_get_tracemalloc_memory_impl()` |  |\r\n|  | lifecycle | `tracemalloc_deinit()` \\+ | `tracemalloc_init()` \\* |\r\n|  | internal | `tracemalloc_get_traces_table()`\u003cBR/\u003e`tracemalloc_remove_trace()` (indirect)\u003cBR/\u003e`tracemalloc_get_traceback()` (indirect)\u003cBR/\u003e`tracemalloc_clear_traces()` \\+\u003cBR/\u003e`tracemalloc_add_trace()` \\+ |\r\n| `empty_traceback` | lifecycle | `tracemalloc_init()` \\+ |  |\r\n|  | internal | `traceback_new()` |  |\r\n| `reentrant_key` | lifecycle | `tracemalloc_init()` \\+\u003cBR/\u003e`tracemalloc_deinit()` \\+ |  |\r\n|  | allocator | `tracemalloc_alloc_gil()` (indirect) \\+\u003cBR/\u003e`tracemalloc_realloc_gil()` (indirect) \\+\u003cBR/\u003e`tracemalloc_raw_alloc()` (indirect) \\+\u003cBR/\u003e`tracemalloc_raw_realloc()` (indirect) \\+ |  |\r\n|  | internal | `get_reentrant()`\u003cBR/\u003e`set_reentrant()` \\+ |  |\r\n\r\n\\* the function allocates/deallocates the value (see below)\r\n\\+ the function mutates the value (see below)\r\n\r\nsimple (extraneous):\r\n\r\n| name | context | allocate/deallocate | get (assert-only) |\r\n| ---- | ---- | ---- | ---- |\r\n| `config.tracing` | internal |  | `tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_remove_trace()` |\r\n| `tables_lock` | lifecycle | `tracemalloc_init()`\u003cBR/\u003e`tracemalloc_deinit()` |  |\r\n| `traced_memory` | internal |  | `tracemalloc_remove_trace()` |\r\n| `filenames` | lifecycle | `tracemalloc_init()` |  |\r\n| `traceback` | lifecycle | `tracemalloc_start()`\u003cBR/\u003e`tracemalloc_stop()` | `tracemalloc_start()` |\r\n| `tracebacks` | lifecycle | `tracemalloc_init()` |  |\r\n| `traces` | lifecycle | `tracemalloc_init()` |  |\r\n| `domains` | lifecycle | `tracemalloc_init()` |  |\r\n\r\nmutation of complex fields:\r\n\r\n| name | context | initialize | finalize | clear | modify |\r\n| ---- | ---- | ---- | ---- | ---- | ---- |\r\n| `allocators.mem` | lifecycle | `tracemalloc_start()` |  |  |  |\r\n| `allocators.raw` | lifecycle | `tracemalloc_init()`\u003cBR/\u003e`tracemalloc_start()` |  |  |  |\r\n| `allocators.obj` | lifecycle | `tracemalloc_start()` |  |  |  |\r\n| `tables_lock` | module |  |  |  | `_tracemalloc__get_traces_impl()`\u003cBR/\u003e`_tracemalloc_get_tracemalloc_memory_impl()`\u003cBR/\u003e`_tracemalloc_get_traced_memory_impl()`\u003cBR/\u003e`_tracemalloc_reset_peak_impl()` |\r\n|  | C-API |  |  |  | `PyTraceMalloc_Track()`\u003cBR/\u003e`PyTraceMalloc_Untrack()`\u003cBR/\u003e`_PyTraceMalloc_NewReference()` |\r\n|  | allocator | `tracemalloc_alloc()` |  |  | `tracemalloc_alloc()`\u003cBR/\u003e`tracemalloc_realloc()`\u003cBR/\u003e`tracemalloc_free()`\u003cBR/\u003e`tracemalloc_realloc_gil()`\u003cBR/\u003e`tracemalloc_raw_realloc()` |\r\n|  | internal |  |  |  | `tracemalloc_clear_traces()`\u003cBR/\u003e`tracemalloc_get_traceback()` |\r\n| `filenames` | internal |  |  | `tracemalloc_clear_traces()` | `tracemalloc_get_frame()`\u003cBR/\u003e`tracemalloc_clear_traces()` |\r\n|  | lifecycle |  | `tracemalloc_deinit()` |  |  |\r\n| `traceback` | internal | `traceback_new()` |  |  |  |\r\n| `tracebacks` | lifecycle |  | `tracemalloc_deinit()` |  |  |\r\n|  | internal |  |  | `tracemalloc_clear_traces()` | `traceback_new()` |\r\n| `traces` | lifecycle |  | `tracemalloc_deinit()` |  |  |\r\n|  | internal |  |  | `tracemalloc_clear_traces()` |  |\r\n| `domains` | lifecycle|  | `tracemalloc_deinit()` |  |  |\r\n|  | internal |  |  | `tracemalloc_clear_traces()` | `tracemalloc_add_trace()` |\r\n| `reentrant_key` | lifecycle | `tracemalloc_init()` | `tracemalloc_deinit()` |  |  |\r\n|  | internal |  |  |  | `set_reentrant()` |\r\n\r\nindirection:\r\n\r\n| name | context | direct | indirect |\r\n| ---- | ---- | ---- | ---- |\r\n| `allocators.raw` | lifecycle | `tracemalloc_start()`\u003cBR/\u003e`tracemalloc_copy_trace()` | `raw_malloc()` |\r\n|  |  | `tracemalloc_stop()` | `raw_free()` |\r\n|  | internal | `traceback_new()`\u003cBR/\u003e`tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_copy_trace()` | `raw_malloc()` |\r\n|  |  | `traceback_new()`\u003cBR/\u003e`tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_remove_trace()` | `raw_free()` |\r\n| `traces` | internal | `tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_remove_trace()`\u003cBR/\u003e`tracemalloc_get_traceback()` | `tracemalloc_get_traces_table()` |\r\n| `domains` | internal | `tracemalloc_add_trace()`\u003cBR/\u003e`tracemalloc_remove_trace()`\u003cBR/\u003e`tracemalloc_get_traceback()` | `tracemalloc_get_traces_table()` |\r\n| `reentrant_key` | allocator | `tracemalloc_alloc_gil()`\u003cBR/\u003e`tracemalloc_realloc_gil()`\u003cBR/\u003e`tracemalloc_raw_alloc()`\u003cBR/\u003e`tracemalloc_raw_realloc()` | `get_reentrant()` |\r\n|  |  | `tracemalloc_alloc_gil()`\u003cBR/\u003e`tracemalloc_realloc_gil()`\u003cBR/\u003e`tracemalloc_raw_alloc()`\u003cBR/\u003e`tracemalloc_raw_realloc()` | `set_reentrant()` |\r\n\r\n\u003c/details\u003e\r\n\r\n\u003c/details\u003e\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-104508\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2023-02-02T21:41:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/101520/cpython/issues/101520"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cb6ca049-5e1b-00cc-3546-cedaa1304e0a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8B36:380972:5A2F25:7C048B:69694C91
html-safe-nonce28fcc791c8b505ff550ca98c5930d45c2dcfb78beec323c186b9cc19def96077
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjM2OjM4MDk3Mjo1QTJGMjU6N0MwNDhCOjY5Njk0QzkxIiwidmlzaXRvcl9pZCI6IjE0NTA4MDM3NjM2OTk1ODAzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8b78948db9813b29f39904d0c151dc04d5ffe3894d165af31a1c1c4c97380a84
hovercard-subject-tagissue:1568827299
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/101520/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f8d197f7a94420ea41bed558d06f9b681c36be88e2d65fb6cae5a8e328270393/python/cpython/issues/101520
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f8d197f7a94420ea41bed558d06f9b681c36be88e2d65fb6cae5a8e328270393/python/cpython/issues/101520
og:image:alt(See #100227.) Currently the tracemalloc module has some state in _PyRuntimeState, including objects, which is shared by all interpreters. Interpreters should be isolated from each other, for a var...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameericsnowcurrently
hostnamegithub.com
expected-hostnamegithub.com
None54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released69ac0477df0f87da03b8b06cebd187012d7a930
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/101520#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F101520
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F101520
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/101520
Reloadhttps://github.com/python/cpython/issues/101520
Reloadhttps://github.com/python/cpython/issues/101520
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/101520
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/101520
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/101520
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/101520
Isolate the tracemalloc Module Between Interpretershttps://github.com/python/cpython/issues/101520#top
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/ericsnowcurrently
https://github.com/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
on Feb 2, 2023https://github.com/python/cpython/issues/101520#issue-1568827299
#100227https://github.com/python/cpython/issues/100227
docshttps://docs.python.org/3.12/c-api/memory.html#customize-memory-allocators
https://github.com/python/cpython/blob/main/Include/internal/pycore_tracemalloc.h#L57-L107https://github.com/python/cpython/blob/main/Include/internal/pycore_tracemalloc.h#L57-L107
https://github.com/python/cpython/blob/main/Include/internal/pycore_runtime.h#L147https://github.com/python/cpython/blob/main/Include/internal/pycore_runtime.h#L147
cpython/Include/internal/pycore_tracemalloc.hhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Include/internal/pycore_tracemalloc.h#L43-L55
0675b8fhttps://github.com/python/cpython/commit/0675b8f032c69d265468b31d5cadac6a7ce4bd9c
cpython/Include/internal/pycore_tracemalloc.hhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Include/internal/pycore_tracemalloc.h#L57-L64
0675b8fhttps://github.com/python/cpython/commit/0675b8f032c69d265468b31d5cadac6a7ce4bd9c
cpython/Include/internal/pycore_tracemalloc.hhttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Include/internal/pycore_tracemalloc.h#L57-L107
0675b8fhttps://github.com/python/cpython/commit/0675b8f032c69d265468b31d5cadac6a7ce4bd9c
cpython/Modules/_tracemalloc.chttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Modules/_tracemalloc.c#L54-L55
0675b8fhttps://github.com/python/cpython/commit/0675b8f032c69d265468b31d5cadac6a7ce4bd9c
cpython/Modules/_tracemalloc.chttps://github.com/python/cpython/blob/0675b8f032c69d265468b31d5cadac6a7ce4bd9c/Modules/_tracemalloc.c#L69-L76
0675b8fhttps://github.com/python/cpython/commit/0675b8f032c69d265468b31d5cadac6a7ce4bd9c
docshttps://docs.python.org/3.12/c-api/memory.html#customize-memory-allocators
GH-101520: Move tracemalloc functionality into core, leaving interface in Modules. #104508https://github.com/python/cpython/pull/104508
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
Subinterpretershttps://github.com/orgs/python/projects/3
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.