[Webtest] Re: Memory Leak in Canoo

Rob Manthey Rob Manthey <canoo@rob.manthey.id.au>
Tue, 05 Dec 2006 12:14:34 +1000

(I'll probably be corrected shortly, but I think this is what Marc is 
getting at ...)

This line (may have been slightly modified by me for my local 
conditions) must appear somewhere for webtest to work:
  <taskdef file="${canoowebtest.home}/webtestTaskdefs.properties"/>

Anyway, each time it is included it instantiates a bunch of resources 
from the sounds of it and so it should only be run once per set of 
tests.  I guess this means wrapping it in some sort of conditional, but 
I have at the top of each file, so that's why (?) I accumulate memory 
usage when I hit "ant all" as the jvm is created once per ant session, 
but the webtest taskdef is called for every file.

What is the optimal way to have the taskdef declared for each file, but 
so that it only gets called once if that file is referenced by wrapper 
files?   Such as:

    <ifStep description="Run Taskdef Once" 
        <taskdef file="${canoowebtest.home}/webtestTaskdefs.properties"/>
        <property name="taskdefLoaded" value="true" />


on 05/12/06 03:50 Ritesh Trivedi said the following:
> Marc,
> Not sure I understand  your comment. Can you please elaborate?
>> is it possible that you declare the webtest tasks for each WebTest?
>> Marc.