memory leak?

  • Thread starter Gabriel Rossetti
  • Start date
G

Gabriel Rossetti

I have been debugging a distributed application for about 2 days that
has a memory leak. My app is a Twisted app, so I thought that maybe it
was on the twisted side, I finally isolated it to no being a Twisted
problem but a Python problem. The problem comes from the code that uses
wxPython and pySerial, these each run in a different process. I wrote
test programs, one "pure" wxPython, one "pure" pySerial and let them
run. The number of objects in the wxPython code doubles in about an
hour, the pySerial code doubles about every 10 minutes. I think there is
something wrong with the GC/memory management or C lib. The wxPython lib
is big, so it may have bugs, but pySerial is small and pure python (no
C/C++ directly, event thought it uses os.open/close & termios that
themselves use C (unless I mistaking)) and I reviewed it's code and I
see nothing that could cause this.

I ran these tests on linux 2.6 (ubuntu 8.04) using python 2.5.2. I used
the "ps" command to see the memory usage and also a recipe that I found
that counts the number of objects. I attached the pyserial, wxPython
code & the recipe. To test them just run each example and run "ps waux |
grep python" once in a while, or send the process a SIGUSR1 and it will
print in the terminal the object count. The wxCode has a refresh
problem, if you use the SIGUSR1/object count method you have to right
click on the taskbar icon to have it show up in the terminal.

I hope I wrong and the problem is elsewhere though.

Thank you very much,
Gabriel
 

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

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top