Python Forum
memory leak on embedded python in c++
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
memory leak on embedded python in c++
#4
I'm not saying that you must never call them several times, but I don't see a good reason for calling them a very large number of times.

The documentation of Py_FinalizeEx() says
Quote:Bugs and caveats: The destruction of modules and objects in modules is done in random order; this may cause destructors (__del__() methods) to fail when they depend on other objects (even functions) or modules. Dynamically loaded extension modules loaded by Python are not unloaded. Small amounts of memory allocated by the Python interpreter may not be freed (if you find a leak, please report it). Memory tied up in circular references between objects is not freed. Some memory allocated by extension modules may not be freed. Some extensions may not work properly if their initialization routine is called more than once; this can happen if an application calls Py_Initialize() and Py_FinalizeEx() more than once.
Reply


Messages In This Thread
memory leak on embedded python in c++ - by asdf3721 - Jul-15-2020, 07:03 PM
RE: memory leak on embedded python in c++ - by Gribouillis - Jul-16-2020, 06:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run detectron2, as python embedded code in C++, on GPU? hassaniqbal931 3 1,108 Nov-02-2023, 04:45 PM
Last Post: blabling2
  Adding libraries to embedded Python as a ZIP The_Oman 0 1,242 May-05-2023, 04:05 PM
Last Post: The_Oman
  python list out top 10 Memory utilisation mg24 0 811 Nov-20-2022, 10:51 PM
Last Post: mg24
Bug Embedded Python Memory Leaks Alexei 1 1,035 Sep-16-2022, 01:15 PM
Last Post: Alexei
  Embedded Python in C++ Xeno 19 3,572 Aug-03-2022, 07:29 AM
Last Post: Gribouillis
  python memory rd_rakesh 1 1,655 Jul-14-2021, 11:15 AM
Last Post: jefsummers
  Where is the memory leak in this Flask Code? Morkus 1 5,603 Jun-18-2021, 02:48 PM
Last Post: Oliver
  Embedded python fails to compile on Raspberry Pi tryfon 2 3,488 Dec-22-2020, 02:06 PM
Last Post: tryfon
  Can Embedded Python run any shared library on Android ? sprotz 0 2,331 Nov-08-2020, 12:21 PM
Last Post: sprotz
  Windows Python Memory Scanner Awesometech 1 21,899 Oct-14-2020, 07:44 AM
Last Post: badengagen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020