t/codingstd/perlcritic.t is currently using 500+MP and growing on my sistem, and 95% cpu, after only 2min running. and it's still on test 1 of 17. this is way too many resources. somebody's got to find a way to make it friendlier. sooner rather than later.
I noticed this before the test was changed to be one-test-per-policy (previously one test per file) as my system is a bit low on resources. After some poking around and a bit of memory measurement I found out that each time critique() is called the memory usage increases. It looks like a memory leak, most probably with how Perl::Critic is used[1], but I can't be sure as I didn't poke around much further[2]. When the tests finish (for a given policy, say) then all the memory is grabbed back nicely. I was thinking of having a separate test file for each policy which calls perlcritic.t and so be able to use the fact that all the memory is released as a way to minimise the impact of the problem. I tried a couple of times, but couldn't find a good solution. Anyway, just some random bits of info which might help someone stomp this bug on bug day. Regards, Paul [1] if I commented out the call to critique() then the memory usage stayed the same, but of course didn't do anything (useful)! [2] one thing I tried was to reset the $critic object each time through the loop, but the memory usage/increase stayed the same.