473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Fwd: Memory leak in python

Hi Nick,

Thanks for reply... Please include me in reply.
Currently i am not in the list (i will subscribe soon)

I upgarded to 2.4.1 - still the same issue.

Nick>
Thats not a lot of leak - have you done that over a
longer time period?

Abhi>
I have tried for 4 days. It has reached 150MB.

Nick>
Are there any objects in gc.garbage?
gc.set_debug(gc.DEBUG_LEAK)
gc.get_debug( ) 62 gc.collect() 0 gc.garbage []
Abhi>
There is none.

Nick>
Are you writing objects with __del__ methods? If so
then that is your problem probably.

Abhi>
I have not written any __del__ methods.

Nick>
Have you written any C extension modules in C?

Yes. Many - All of them are called only
when the app starts. And never called again.
Till then it is stable only - 16MB used.

I have tried following - let me know if you need any
more details.. and want me to try something.

1)
I found a "sizer" python program. Which gives me the
module which is growing. It indicates that __main__ is
growing.

__main__': 4000774

2) I tried following.. (not smart but..)

def f():
c = gc.get_objects()
j = 0
for i in c:
j = j + 1
try:
tmp = len(i)
if tmp > 1000:
print "(c[%d]) (%d)," % (j-1, tmp)
except:
pass

it prints me as folows:

l(c[175]) (7336),
l(c[12475]) (1260),
l(c[12477]) (1260),
l(c[12479]) (1381),
l(c[12481]) (1381),
l(c[34159]) (1200),
l(c[37144]) (28234),
l(c[37191]) (28286), type(c[37191]) <type 'dict'> for k,v in c[37164].items():

.... print k, v
.... b = b + 1
.... if b > 30:
.... break
....
1085115764 620
1080048556 2
1085045932 4
1085146316 1
1085246700 2
1090615060 9
1089571940 2
1090519084 2
1090876932 234
1093456364 48
1085168140 2
1089964748 6
1089994828 0
1090095684 69
1076932268 2
1085014108 6
1080092204 10
1084888812 1
1118543628 48
1089994860 6
1076731524 6
1079640188 3
1084883076 15
1079712492 1
1118459244 64
1080295564 1
1076522028 4
1085211788 2
1076887700 20
1076729756 70
1091012236 2

This two dict in the last is growing slowly..
I am not maintaing any dict with such indices and
value.

Any clue?
Please let me know what else to check and how!

At the time i am ending this.. module size..
'__main__': 7926830,

Thanks,
Abhishek

Note: forwarded message attached.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Jul 19 '05 #1
0 1015

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

Similar topics

10
by: Debian User | last post by:
Hi, I'm trying to discover a memory leak on a program of mine. I've taken several approaches, but the leak still resists to appear. First of all, I've tried to use the garbage collector to...
3
by: Guy | last post by:
Hi It might take me a little time to explain this but here goes. Firstly I'm not using the latest upto date python releases so my first plan is to try more upto date rels of python and win32...
2
by: Elbert Lev | last post by:
#When I'm running this script on my windows NT4.0 box, #every time dialog box is reopened there is memory growth 384K. #Bellow is the text I sent to Stephen Ferg (author of easygui) # I have...
10
by: Andrew Trevorrow | last post by:
No response to my last message, so I'll try a different tack... Does anyone know of, or even better, has anyone here written a C++ application for Mac/Windows that allows users to run Python...
18
by: diffuser78 | last post by:
I have a python code which is running on a huge data set. After starting the program the computer becomes unstable and gets very diffucult to even open konsole to kill that process. What I am...
0
by: nejucomo | last post by:
Hi folks, Quick Synopsis: A test script demonstrates a memory leak when I use pythonic extensions of my builtin types, but if I use the builtin types themselves there is no memory leak. ...
3
by: crazy420fingers | last post by:
I'm running a python program that simulates a wireless network protocol for a certain number of "frames" (measure of time). I've observed the following: 1. The memory consumption of the program...
0
by: Gabriel Genellina | last post by:
En Wed, 16 Apr 2008 13:10:42 -0300, rkmr.em@gmail.com <rkmr.em@gmail.comescribió: In principle pure Python code should have no memory leaks - if there are, they're on Python itself. Maybe...
4
by: Christian Heimes | last post by:
Gabriel Genellina schrieb: Pure Python code can cause memory leaks. No, that's not a bug in the interpreter but the fault of the developer. For example code that messes around with stack frames...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.