Item2286: looking into why the unit test FoswikiSuite uses more memory over time

pencil
Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: CrawfordCurrie
basically, I am wondering if there's a memory leak that will show up in run time, or if its just sloppy test code (I'm beginning to think the latter.)

-- SvenDowideit - 24 Oct 2009

Touch of over-enthusiasm there; clearing the static session object in extender.pl is going to blow away any installation checkins after the first. Need:
Index: extender.pl
===================================================================
--- extender.pl   (revision 5505)
+++ extender.pl   (working copy)
@@ -161,9 +161,6 @@
 # Can't do this until we have setlib.cfg
 require Foswiki::Configure::Dependency;
 
-$session->finish();
-undef $session;
-
 sub remap {
     my $file = shift;

-- CrawfordCurrie - 13 Nov 2009

its been working for a while, so closing smile

-- SvenDowideit - 18 Jun 2010

The unit tests are definitely using more memory. I noticed that because the FoswikiSuite no longer runs on my dev machine. Devel::Leak::Object shows there are objects that are not being cleaned up. I'm investigating.

Foswiki::Request does not have a finish() method. I am unsure of the implications of adding one, because Foswiki::new()'s $query parameter is a Foswiki::Request object but Foswiki::new() creates its own Foswiki::Request if the $query is false (i.e. undef). Foswiki::finish() should not "finish" the Foswiki::Request object if it was passed as an input (but it should "finish" the one it creates itself).

-- MichaelTempest - 15 Aug 2010

I am not sure how much of the output from Devel::Leak::Object is noise, and my attempt at cleaning up broke lots of things, so I abandoned that attempt. In consequence, I didn't add a finish() for Foswiki::Request.

However, I did find (and fix) an incorrect name in the StoreSmokeTests. I also found that Foswiki::finish() didn't list all of its fields.

I moved Fn_SEARCH to run its own process and now the unit tests run on my machine.

-- MichaelTempest - 22 Aug 2010
Topic revision: r17 - 06 Sep 2010, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy