New submission from STINNER Victor <vstin...@python.org>:

I never used sys._debugmallocstats() function or PYTHONMALLOCSTATS environment 
variable, whereas I spend significant time on optimizing memory allocators and 
free lists. The output is written into stderr which is very convenient to 
process these data.

I only "re"-discovered recently this debug feature when writing PR 20247 "Make 
tuple free list per-interpreter": I had to update _PyTuple_DebugMallocStats().

Removing this debug feature reduces the maintenance burden.

Attached PR removes all code related to the sys._debugmallocstats() function 
and the PYTHONMALLOCSTATS environment variable.

If someone wants to hack Python memory allocators or free lists, I suggest to 
add temporary code to dump some stats. But I don't think that it's worth it to 
keep the feature for all uses in Python.

People who worry about the memory usage of their application don't have to go 
into this low level of details, but care more about memory peak, where the 
memory was allocated (ex: tracemalloc module), RSS memory, etc.

----------
components: Interpreter Core
messages: 369987
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove sys._debugmallocstats() function and PYTHONMALLOCSTATS 
environment variable
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40781>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to