Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #41230] [BUG] t/codingstd/perlcritic.t uses too many resources

6 views
Skip to first unread message

Jerry Gay

unread,
Jan 10, 2007, 6:21:38 PM1/10/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Jerry Gay
# Please include the string: [perl #41230]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41230 >


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.
~jerry

Paul Cochrane

unread,
Jan 10, 2007, 8:13:55 PM1/10/07
to perl6-i...@perl.org
> 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.

Jerry Gay

unread,
Jan 26, 2007, 11:48:37 AM1/26/07
to parrotbug...@parrotcode.org
On 1/24/07, Jeffrey Thalhammer via RT <parrotbug...@parrotcode.org> wrote:
> Perl-Critic-1.01 is on its way to a CPAN mirror near you. I ran all
> the way through codingstd/perlcritic.t on my wimpy Win32 machine, and
> memory utilization was stable during the entire run when using Perl-
> Critic-1.01. Let me know how it goes for you.
>
indeed, after installing 1.01, memory utilization hovers around 40MB
throughout the test. looks like you plugged the leak. congrats on the
release, and thanks for the fix!
~jerry

Will Coleda via RT

unread,
Mar 13, 2007, 12:32:19 AM3/13/07
to perl6-i...@perl.org
Updated to run *all* the policies at once (thereby only processing each file via PPI once), but still
break out the test reports by policy.

Runtime for comparable tests now at 1m15s, down from 16m8s, ~13 times speedup. Memory
usage stayed under 50M the whole time (using Perl::Critic 1.03)

Stripping of languages/ files (RT#41231), we're down to 41s. (~24 times speedup)

Please test on windows and close ticket if it works there.

0 new messages