GitHub issue: Python Memory Leaks
State: open

Hi,
I write here for a solution to memory leaks I applied for frvt 1:1 submission but got a memory leak error I have also tested with Valgrind for memory leaks checking there are so many memory leaks detected like `invalid read of size 4` or maybe that is not the memory leak can any provide guidance about to check where exactly memory leaks occur or second approach would be to convert the model into c++ which should be better debugging memory leaks or converting python code into c++
by the way, I am using retinaface library for face detection and insightFace for feature extraction.
here is Valgrind output slice
`==140416==    by 0x49F424B: Py_InitializeEx (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x1091ED: main (in /additional_drive/nist/frvt_onnx_sequential/11/test_mem)
==140416==  Address 0x5387020 is 1,520 bytes inside a block of size 2,208 free'd
==140416==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==140416==    by 0x4ACD397: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4AC9E1F: PyDict_SetDefault (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4A62DFF: PyUnicode_InternInPlace (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4A62E90: PyUnicode_InternFromString (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4AFC4C1: PyDescr_NewMethod (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x48E34AA: PyType_Ready (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4AB8E04: _PyTypes_Init (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x49F3A6A: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x49F41A2: Py_InitializeFromConfig (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x49F424B: Py_InitializeEx (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x1091ED: main (in /additional_drive/nist/frvt_onnx_sequential/11/test_mem)
==140416==  Block was alloc'd at
...
...
...
==140416==  Block was alloc'd at
==140416==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==140416==    by 0x4AB69E7: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4B20CB7: PyGrammar_AddAccelerators (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4B23184: PyParser_New (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4B26DD2: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x49E79DA: PyParser_ASTFromStringObject (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x49E8387: PyRun_StringFlags (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4A2BADF: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x4ABB546: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x48D0D6C: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x48D246C: _PyEval_EvalFrameDefault (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416==    by 0x48DC06A: ??? (in /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0)
==140416== 
==140416== ERROR SUMMARY: 898 errors from 107 contexts (suppressed: 0 from 0)`