Hi dear Python team,
I am a building a c/c++ application for general purpose and I would like to have in the application the possibility of running “Python” scripting code. Python has proved to be a good programming language to deal with heavy Math as in AI.
Now when I embed Python in my application things go perfect, except for memory leaks!
As a sample, by just issuing the following code leaves memory leaks of around (2Mb):
thanks
I am a building a c/c++ application for general purpose and I would like to have in the application the possibility of running “Python” scripting code. Python has proved to be a good programming language to deal with heavy Math as in AI.
Now when I embed Python in my application things go perfect, except for memory leaks!
As a sample, by just issuing the following code leaves memory leaks of around (2Mb):
#define PY_SSIZE_T_CLEAN #define Py_LIMITED_API 0x03000000 #include <Python.h> #pragma comment (lib,"python3.lib") int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) { Py_InitializeEx(0); //For Embeded Python Py_FinalizeEx(); ..More code.. return 0; }Is there something I must do to cause Python to release all resources allocated
thanks
Larz60+ write Sep-15-2022, 09:54 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Your indentation is off, and needs fixing
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Your indentation is off, and needs fixing