Closed qwenger closed 2 years ago
Currently, when testing check_memory.py, most tracebacks come from standard packages, thus are not useful (if I understand tracemalloc correctly).
check_memory.py
tracemalloc
I suggest to filter for tracebacks originating only from quickjs/__init__.py or test_quickjs.py.
quickjs/__init__.py
test_quickjs.py
Note: we could also filter out the different unwanted packages, but then we'd end up with something like that (plus all the corresponding imports):
filters = [ tracemalloc.Filter(False, tracemalloc.__file__), tracemalloc.Filter(False, threading.__file__), tracemalloc.Filter(False, re.__file__), tracemalloc.Filter(False, re.sre_compile.__file__), tracemalloc.Filter(False, re.sre_parse.__file__), tracemalloc.Filter(False, weakref.__file__), tracemalloc.Filter(False, _weakrefset.__file__), tracemalloc.Filter(False, unittest.suite.__file__), tracemalloc.Filter(False, unittest.case.__file__), tracemalloc.Filter(False, unittest.loader.__file__), tracemalloc.Filter(False, unittest.runner.__file__), tracemalloc.Filter(False, unittest.result.__file__), tracemalloc.Filter(False, fnmatch.__file__), tracemalloc.Filter(False, concurrent.futures.thread.__file__), tracemalloc.Filter(False, concurrent.futures._base.__file__), tracemalloc.Filter(False, abc.__file__), tracemalloc.Filter(False, traceback.__file__), tracemalloc.Filter(False, posixpath.__file__), tracemalloc.Filter(False, json.encoder.__file__), tracemalloc.Filter(False, __file__), tracemalloc.Filter(False, "<unknown>"), ]
Note2: even after filtering, tracebacks remain... does that mean that we do have memory leaks in module.c?
module.c
We'll have to look into that, but yes, that should be a memory leak.
Currently, when testing
check_memory.py
, most tracebacks come from standard packages, thus are not useful (if I understandtracemalloc
correctly).I suggest to filter for tracebacks originating only from
quickjs/__init__.py
ortest_quickjs.py
.Note: we could also filter out the different unwanted packages, but then we'd end up with something like that (plus all the corresponding imports):
Note2: even after filtering, tracebacks remain... does that mean that we do have memory leaks in
module.c
?