473,805 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

interpreter Py_Initialize/Py_Finalize mem leak?


In pure curiosity I tried to compile loop.c from Demo/embed
and started it with 'print 2+2'. It seems, that both 2.3 and 2.4
pythons have memory leaks in Py_Initialize/Py_Finalize calls.
(That is, interpreter doesn't clean up well after itself).

This is my setup:

gcc -fpic loop.c -DHAVE_CONFIG_H -lm -lpython2.4 \
-lpthread -lutil -ldl \
-I/usr/local/include/python2.4 \
-L/usr/local/lib/python2.4/config \
-o looptest

(It's on Linux RedHat 7.3)

I do not know if this is of any importance though. Probably it is
for embedded Python uses.

Sincerely yours, Roman Suzi
--
rn*@onego.ru =\= My AI powered by GNU/Linux RedHat 7.3
Jul 18 '05 #1
0 1199

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1854
by: Atul Kshirsagar | last post by:
I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi-threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to explain it in details, 1. Python initialization and finalization is done in the *main* thread. 2. For each new thread I create a separate sub-interpreter . 3. Using PyRun_String("import myModule"...) before execution of python
0
1047
by: The Dark Seraph | last post by:
Hi- I am writting an application in C++ that I am attempting to embed an interpreter in. I know about how I need to protect the interpreter internals from mean nasty threads in my program, but I am runnning across a problem I don't quite understand. Here is my flow of control: C++ Main starts up
2
1873
by: Charlie DeTar | last post by:
So, I have an amazing, functioning foobar class that embeds python. Only trouble is, I want to be able to have multiple foobar objects at once, each with their own interpreters, stdouts, and stderrs. My initialization of the python interpreter in the class "x" is as follows: if (!Py_IsInitialized()) { PyEval_InitThreads(); Py_Initialize(); }
1
2272
by: pdectm | last post by:
I'm trying to prototype an application which runs multiple python scripts, each in its own interpreter and OS thread. I've not been able to forceable stop a script which does not respond to a request to stop. My thought was to simply call: PyThreadState_Clear(xxx); PyThreadState_Delete(xxx); // Fatal Python error: no last thread Py_EndInterpreter(xxx);
0
2403
by: Andrew Trevorrow | last post by:
Hi folks, I've only been using Python for a few weeks, so please be gentle. :) Lovely language by the way -- I really enjoying using it -- but I've struck a very nasty problem when running Python scripts from my app. Summary: Multiple Py_Initialize/Py_Finalize calls result in bad memory leaks,
0
1449
by: eastier | last post by:
Hi all, I've an application with embedded python. In order to reload the python scripts, I end the python session, and reopen one just after : <...release used modules...> Py_Finalize();
3
2016
by: ycollet | last post by:
Hello, I've written a C embedded application. I want to open a python gui application in my C program but when I do : PyRun_String( "import gui.py", file_input, pDictionary, pDictionary ); the interpreter emits an error: tkinter module not defined What script must I load to initialize the embedded python interpreter
0
1184
Bulldog
by: Bulldog | last post by:
I have been playing around with this issue for a while and seen some previous posting trying to address the problem but I haven't seen any answers to the problem so I am reposting it in my quest for a solution. I am using python 2.2.3, because I am using some dSpace software (controldesk/automationdesk) that is based upon that version of python. I have some pre-compiled python modules that come with the dspace applications. I am pretty sure...
11
2212
by: sturlamolden | last post by:
Python has a GIL that impairs scalability on computers with more than one processor. The problem seems to be that there is only one GIL per process. Solutions to removing the GIL has always stranded on the need for 'fine grained locking' on reference counts. I believe there is a second way, which has been overlooked: Having one GIL per interpreter instead of one GIL per process. Currently, the Python C API - as I understand it - only...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.