getrusage

S

Stuart D. Gathman

When I call resource.getrusage on Linux, I don't get any memory stats:

Python 2.2.2 (#1, Jan 30 2003, 21:26:22)
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
On AIX, I get the correct numbers.

What is the goal? I need to find a memory leak in an extension module.
For starters, I was going to find extension method calls that produce
unexpected memory use (and I found some on AIX - but our 12 year old AIX
system is *so* slow). Suggestions are welcome.
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Stuart said:
When I call resource.getrusage on Linux, I don't get any memory stats:

Python 2.2.2 (#1, Jan 30 2003, 21:26:22)
[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

(0.019531, 0.0078119999999999995, 0, 0, 0, 0, 178, 387, 0, 0, 0, 0, 0, 0, 0, 0)

On AIX, I get the correct numbers.

On FreeBSD, you get correct numbers as well. The Linux kernel, however,
doesn't implement the RUSAGE field, even though it could easily be done
(I once had the same question as you, and did this research then).
What is the goal? I need to find a memory leak in an extension module.

Try compiling a debug version of Python with the option --with-debug and
you can debug refcount problems much better.

-- Gerhard
 
S

Stuart D. Gathman

On FreeBSD, you get correct numbers as well. The Linux kernel, however,
doesn't implement the RUSAGE field, even though it could easily be done
(I once had the same question as you, and did this research then).


Try compiling a debug version of Python with the option --with-debug and
you can debug refcount problems much better.

The leak turned out to be in the C library wrapped by the extension
module. I debugged the C library with http://dmalloc.com

Very nice package.
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top