Message355187
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
--- |
|
Date |
User |
Action |
Args |
2019-10-23 00:11:30 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc, kylotan, tlesher, ysj.ray, santoso.wijaya, pconnell, isoschiz, Alex Budovski |
2019-10-23 00:11:30 | vstinner | set | messageid: <1571789490.17.0.868873182214.issue1635741@roundup.psfhosted.org> |
2019-10-23 00:11:30 | vstinner | link | issue1635741 messages |
2019-10-23 00:11:30 | vstinner | create | |
|