Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 59087
Status: resolved
Priority: 0/
Queue: Test-Harness

People
Owner: andy [...] hexten.net
Requestors: mkanat [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 3.21
Fixed in: 3.27



Subject: prove uses a lot of memory when running one test with large output
I have a single test script that runs about 1.5 million tests (that is, it produces about 1.5 million lines of TAP output). Running this test causes "prove" to use about 450MB of RAM. Using a simple memory debugging tool that I wrote around Devel::Gladiator, I can see that the items taking up the most memory are three hashes, with these keys: {_closures,formatter,name,ok_callbacks,parser,show_count} {iterator,ordered_tokens,parser,tokens,version} {_grammar,_iter,_iterator,_spool,actual_failed,actual_passed,code_for,fa iled,grammar_class,in_todo,iterator_factory_class,ok_callbacks,parse_err ors,passed,plan,pragma,result_factory_class,results,skipped,start_time,t ap,tests_planned,tests_run,todo,todo_passed,version} I haven't drilled into the code too much to examine what these are, although I'd guess the top one is a TAP::Formatter::Console::Session. Now, as a side note, I suspect that some people may respond, "your script shouldn't run so many tests and it should be parallelized somehow instead". Well, yes, that's actually how I got it *down* to running 1.5 million tests--it used to run 60 million. There's actually a fairly rational reason it's running so many tests--it has to test a large number of combinations of input, all of which are unique. The test script itself uses only 60MB of RAM for all its work, but prove is expanding linearly, it seems, with the number of tests I run.
On Sun Jul 04 06:07:47 2010, MKANAT wrote: Show quoted text
> I have a single test script that runs about 1.5 million tests (that is, > it produces about 1.5 million lines of TAP output). Running this test > causes "prove" to use about 450MB of RAM. > > Using a simple memory debugging tool that I wrote around > Devel::Gladiator, I can see that the items taking up the most memory are > three hashes, with these keys: > > {_closures,formatter,name,ok_callbacks,parser,show_count} > > {iterator,ordered_tokens,parser,tokens,version} > > {_grammar,_iter,_iterator,_spool,actual_failed,actual_passed,code_for,fa > iled,grammar_class,in_todo,iterator_factory_class,ok_callbacks,parse_err > ors,passed,plan,pragma,result_factory_class,results,skipped,start_time,t > ap,tests_planned,tests_run,todo,todo_passed,version} > > I haven't drilled into the code too much to examine what these are, > although I'd guess the top one is a TAP::Formatter::Console::Session. > > Now, as a side note, I suspect that some people may respond, "your > script shouldn't run so many tests and it should be parallelized somehow > instead". Well, yes, that's actually how I got it *down* to running 1.5 > million tests--it used to run 60 million. There's actually a fairly > rational reason it's running so many tests--it has to test a large > number of combinations of input, all of which are unique. > > The test script itself uses only 60MB of RAM for all its work, but prove > is expanding linearly, it seems, with the number of tests I run.
This issue has been resolved in Test-Harness 3.27, as bug #84939. I'm marking this as resolved. Leon