New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leaks when embedded interpreter is reinitialized #65586
Comments
Following https://docs.python.org/2/c-api/init.html#Py_Finalize, I'm reinitializing embedded python interpreter multiple time in one process. #include <Python.h>
void f() {
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"import datetime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
}
int main(void) {
for (int i = 0; i < 30; ++i)
f();
return 0;
} I see 2 sources of memory leaks:
==20144==ERROR: LeakSanitizer: detected memory leaks Direct leak of 8120 byte(s) in 29 object(s) allocated from:
Direct leak of 8120 byte(s) in 29 object(s) allocated from: |
Thanks. It would be nice if you could try the same with Python 3.4, or the development version. |
Are we fixing these on a case by case basis or is it hopeless (msg146615)? |
I think fixing on a case by case is fine. |
For the record, the open issues about applying 3121 and 384 to the standard libary: http://bugs.python.org/issue?%40columns=id%2Cactivity%2Ctitle%2Ccreator%2Cassignee%2Cstatus%2Ctype&%40sort=-activity&%40filter=status&%40action=searchid&ignore=file%3Acontent&%40search_text=pep+3121&submit=search&status=-1%2C1%2C3 |
Duplicate of bpo-1635741. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: