Memory leak in python-2.2.3 on solaris?

E

Erwin Dahl

I have an all python (ie no c code) daemon program that sits in a loop
doing stuff (pinging machinies). It had been running fine in
python-2.1.3 for over a year. Last week I upgraded python to 2.2.3
and it started leaking memory very quickly (over 100 pages per loop).
I fired up a debug version of python-2.2.3 and I see that the object
ref count stays the same across loop iterations. I also tried 2.3.2
and it had no leak problem. Now I know that python-2.2.3 isn't the
current version but its what I need as a result of some of the
libraries I'm using.

My questions are:

- is this really a leak in python (or one of its libraries)?

- if gettotalrefcount() stays the same it must be a C level leak,
correct?

- if so what is the best way to figure it out?

I'm on solaris 2.8 and python is built with gcc 3.2.2. The program
doesn't use many libraries the ones that I haven't been able to pull
when debuging are socket and select so I suspect them.

-EAD
 
M

Martin v. =?iso-8859-15?q?L=F6wis?=

- is this really a leak in python (or one of its libraries)?

Without seeing the source code, nobody can tell.
- if gettotalrefcount() stays the same it must be a C level leak,
correct?

If it is a leak: yes.
- if so what is the best way to figure it out?

Add a breakpoint on malloc, and find out what its callers are.
I'm on solaris 2.8 and python is built with gcc 3.2.2. The program
doesn't use many libraries the ones that I haven't been able to pull
when debuging are socket and select so I suspect them.

You might want to incorporate them statically into Python, by
modifying Modules/Setup.

Regards,
Martin
 
M

Michael Hudson

I'm on solaris 2.8 and python is built with gcc 3.2.2. The program
doesn't use many libraries the ones that I haven't been able to pull
when debuging are socket and select so I suspect them.

Some dusty memory says something about leaks in the socket module.
You might want to look at the CVS logs (or even try release22-maint, I
guess).

Cheers,
mwh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top