18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Sahi Controller Leaks Memory

Raju SurapurajuRaju Surapuraju Members
edited September 2010 in Sahi - Open Source
Using Sahi for functional stress testing and the controller leaks memory after using for sometime.... and when Sahi Contrller is closed it releases memory and gets it back to normal. This is noticed on IE, Chrome and FF (this may also be the case with other browsers...) Otherwise this tool works well...

Thanks and appreciate help! with this...
Raju Surapuraju

Comments

  • kchankchan Members
    edited September 2010
    I think this has to do with the fact that the controller logs each step into a textarea. There's a very noticeable slow-down when running an extensive script in the controller. Running from the command-line has helped me.
  • Thanks KChan. Started using Command Line execution for Sahi scripts.. and no memory leaks now.
  • narayannarayan Administrators
    Thanks KChan and Raju. We will have a look at this.

    Regards,
    Narayan
  • I made changes to the displayLogs function in controller7.js which only displays (and keeps in memory) the last n statements in the playback textarea element. The new function looks as follows:


    function displayLogs(s, i) {
    if (i == null){ // for stop PlayBack messages
    if ($("talogs").value.match(s+"[\r\n]*$")) return;
    }
    if ((""+i) != $("currentStep").innerHTML) {
    $("talogs").value += s + "\n";

    // limit the number of items displayed in playback textarea
    try {
    var items = $("talogs").value.split("\n");
    items = items.slice(-25);
    $("talogs").value = items.join("\n");
    } catch (e) {
    }

    scrollDown($("talogs"));
    }
  • narayannarayan Administrators
    Thanks Jim,

    That code seems to be from Sahi Pro. To make it work in Sahi define scrollDown function like this:
    function scrollDown(el){
        el.scrollTop = el.scrollHeight;
    }
    

    Regards,
    Narayan
  • wgoriswgoris Members
    Hello Narayan,

    I noticed the problem is still present in version v3.5_20110314. Is there a reason why this isn't fixed in the free version?

    Best regards,
    Werner
Sign In or Register to comment.