Closed GoogleCodeExporter closed 8 years ago
What makes you think it's a memory leak?
Original comment by wj32...@gmail.com
on 27 Oct 2010 at 5:15
We have a script [1] we run against functionalities implemented in pure C which
works as such:
- 1: call C fun 1000 times
- 2: retrieve process memory usage (1)
- 3: call C fun 1000 times
- 4: retrieve process memory usage (2)
If difference between 4 and 2 is > 4 Kbytes we assume the C function has a
memory leak.
This has shown to work so far, revealing places where we forgot to close
process handles, call free(), use Py_DECREF [2], etc.
As for get_connections() I suspect it's not something which has to do with Py_*
objects not being Py_DECREF-ed because the script signals a memory leak even if
I remove those parts from the code.
[1]
http://code.google.com/p/psutil/source/browse/trunk/test/test_memory_leaks.py
[2] http://docs.python.org/c-api/intro.html#reference-counts
Original comment by g.rodola
on 27 Oct 2010 at 9:00
After bumping up number of loops from 1000 to 2000 the problem magically
disappeared.
Closing out as invalid for now, but I think our memory leaks script might
actually have a problem.
Original comment by g.rodola
on 11 Nov 2010 at 11:45
If it goes away with more loops, it could just be garbage collection kicking in
later, so the memory doesn't get reclaimed immediately.
Original comment by jlo...@gmail.com
on 11 Nov 2010 at 2:24
Original issue reported on code.google.com by
g.rodola
on 26 Oct 2010 at 6:44