[issue19817] tracemalloc add a memory limit feature

STINNER Victor report at bugs.python.org
Wed Nov 27 19:03:12 CET 2013


New submission from STINNER Victor:

It would be nice to add a memory_limit feature to the tracemalloc to make memory allocation fails if it would make the traced memory greater than the limit.

See also the pyfailmalloc project which is similar but different:
https://bitbucket.org/haypo/pyfailmalloc

pyfailmalloc doesn't count allocated bytes, it schedules an error in N allocations where N is a random number. And pyfailmalloc only schedules one error, whereas I propose to make all memory allocations fails until the limit is respected.

So if you only 0 bytes free (according to the limit), all memory allocations fail until some bytes are freed.

Python currently behaves badly under very low memory condition.

See also the issue #19437.

----------
files: tracemalloc_memory_limit.patch
keywords: patch
messages: 204605
nosy: haypo, neologix
priority: normal
severity: normal
status: open
title: tracemalloc add a memory limit feature
versions: Python 3.5
Added file: http://bugs.python.org/file32873/tracemalloc_memory_limit.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19817>
_______________________________________


More information about the Python-bugs-list mailing list