[Catalyst] Leak tests

Bill Moseley moseley at hank.org
Thu Sep 9 00:57:49 GMT 2010


Anyone have an example of checking for leaks in their test suite?

Few days ago had some nice 1.6GB Apache processes and thought we had a leak.
 Turned out we had a query that was trying to suck too much out of the
database and it was just doing what it was told, but I still want to add
some general testing for leaks.

I've used CatalystX::LeakChecker in the past but not sure how to incorporate
that into a .t file.

What I initially did was use Linux::Smaps (although /proc/self/statm would
likely do as well) and then in a test ran a request a few times, measured
memory and then ran it 1000 times and looked for a differences in memory
usage.  I'm finding that not very reliable as tests pass on one machine and
then on another fails -- maybe due to how and when the heap just happens to
get allocated.


-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100908/88a49=
e6a/attachment.htm


More information about the Catalyst mailing list