This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Alex Budovski, amaury.forgeotdarc, isoschiz, kylotan, pconnell, santoso.wijaya, tlesher, vstinner, ysj.ray
Date 2019-10-23.00:11:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571789490.17.0.868873182214.issue1635741@roundup.psfhosted.org>
In-reply-to
Content
I tested on the master branch of Python:
---
#include <Python.h>

void func()
{
    Py_Initialize(); Py_Finalize();
    Py_ssize_t cnt = _Py_GetRefTotal();
    printf("sys.gettotalrefcount(): %zd\n", cnt);
}

int main(int argc, char *argv[])
{
    Py_SetProgramName(L"./_testembed");
    for (int i=0; i < 10; i++) {
        func();
    }
}
---

Each iteration leaks around 5,000 Python objects:
---
sys.gettotalrefcount(): 15113
sys.gettotalrefcount(): 19527
sys.gettotalrefcount(): 23941
sys.gettotalrefcount(): 28355
sys.gettotalrefcount(): 32769
sys.gettotalrefcount(): 37183
sys.gettotalrefcount(): 41597
sys.gettotalrefcount(): 46011
sys.gettotalrefcount(): 50425
sys.gettotalrefcount(): 54839
---
History
Date User Action Args
2019-10-23 00:11:30vstinnersetrecipients: + vstinner, amaury.forgeotdarc, kylotan, tlesher, ysj.ray, santoso.wijaya, pconnell, isoschiz, Alex Budovski
2019-10-23 00:11:30vstinnersetmessageid: <1571789490.17.0.868873182214.issue1635741@roundup.psfhosted.org>
2019-10-23 00:11:30vstinnerlinkissue1635741 messages
2019-10-23 00:11:30vstinnercreate