Hunting a memory leak

Edward K. Ream edreamleo at charter.net
Sat Aug 30 13:56:31 CEST 2003


> I would appreciate some ideas.

I doubt many people will be willing to rummage through your app's code to do
your debugging for you.  Here are two general ideas:

1.  Try to simplify the problem.  Pick something, no matter how small (and
the smaller the better) that doesn't seem to be correct and do what it takes
to find out why it isn't correct.  If trackRefs is Python code you can hack
that code to give you more (or less!) info.  Once you discover the answer to
one mystery, the larger mysteries may become clearer.  For example, you can
concentrate on one particular data structure, one particular data type or
one iteration of your test suite.

2. Try to enjoy the problem.  The late great Earl Nightingale had roughly
this advice:  Don't worry. Simply consider the problem calmly, and have
confidence that the solution will eventually come to you, probably when you
are least expecting it.  I've have found that this advice really works, and
it works for almost any problem.  Finding "worthy" bugs is a creative
process, and creativity can be and should be highly enjoyable.

In this case, your problem is: "how to start finding my memory leaks".
Possible answers to this problem might be various strategies for getting
more (or more focused!) information.  Then you have new problems:  how to
implement the various strategies.  In all cases, the advice to be calm and
patient applies. Solving this problem will be highly valuable to you, no
matter how long it takes :-)

Edward

P.S. And don't hesitate to ask more questions, especially once you have more
concrete data or mysteries.

EKR
--------------------------------------------------------------------
Edward K. Ream   email:  edreamleo at charter.net
Leo: Literate Editor with Outlines
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------






More information about the Python-list mailing list