From: "Brett H. Williams" Date: 2003-09-18T22:09:48+09:00 Subject: Re: Testing for memory leaks On Sep 18, Berger, Daniel wrote: > Hi all, > > Being as I write a lot of extensions, I've discovered that it's best to > check for memory leaks. The way I'm doing this now is something like this: > > # pseudo code > while 1 > call some_method > if Linux or BSD > check /proc/Process.pid/fd count > elsif Solaris > check pfiles Process.pid count > elsif Win32 > start Task Manager and watch used file descriptors and memory for > Process.pid > end > sleep 1 > end > > # Ctrl-C to break out of loop only after at least 10 iterations > > Is there a better and/or more streamlined way to do this? Any chance of > adding assert_no_memory_leak to TestUnit, for example? If you only care about x86, you might out valgrind. It integrates nicely with gdb and does a decent job without much effort to get going. -- ---------------------------------------------- | -------------------------- Brett Williams | (970) 288-0475 Agilent Technologies | brett_williams@agilent.com ---------------------------------------------- | --------------------------