Forum Discussion

gopster1283's avatar
gopster1283
Occasional Contributor
9 years ago

TestComplete 11 - memory leak (?)

Friends :

This issue is with TestComplete11-python

 

I noticed that on my machine, the testcomplete memory does not get freed up after execution. In our org, we have a UI automation framework written in python. It uses OOP, classes and all that other good stuff. The framework itself is about 5 libraries with roughly 400-1500 lines of code in each file and about 5-10 classes each as well. The testers will basically import these libraries into their script units and call these ui functions. 

 

I do notice that after a run, TestComplete's process memory size is at least 30MB larger than from the start. Eventually it bombed out at 3.5GB, So when I load TestComplete and a project suite, it starts out at 150MB. Run 1 ends with 180MB roughly, Run 2 starts with 180MB and ends with roughly 205MB. Run 3 starts with 205MB and ends with roughly 240MB, and so on and so forth. 

 

Does anyone have any clues on this issue? Suppressing the logs, removing unnecessary extensions etc. doesn't seem to help. Is garbarge collection being handled correctly? Native python handles GC automatically, however, in TestComplete do I have to explicitly call a destructor? Or, are the import statements being too expensive to load?

10 Replies

  • Contact Customer Support to see if there are any patches relating to memory leaks with Python.

  • anmoldabra's avatar
    anmoldabra
    Occasional Contributor

    I am facing the same issue in C# scripting. 

    RAM usage will be keep on increasing in every test run. 

    It seems TestComplete has not handled garbage collection properly.

     

    Thanks,

    Anmol

  • Manfred_F's avatar
    Manfred_F
    Regular Contributor

    I have experienced the same using vbScript natively and in script extensions.

    I spent lots of time to stop my own object-oriented code to consume Memory (!! do not use vbScript for oo-Code, use JScript and CollectGarbage()!!). Now that this is done, TC alone eats the Memory.

    Support did not help.

  • gopster1283's avatar
    gopster1283
    Occasional Contributor

    I initially discovered the leak in 11.0 python scripting. We went through a cycle of patches and then 11.1-11.31 came along and the effect seems to be minimized FOR running suites and loading python libraries. HOWEVER, for libraries that are over 800 lines, we noticed that while we are adding new lines of code, the memory consumption bubbles up uncontrollably. We logged a support ticket which SB seems keen to fix. This is an unacceptable issue that needs to be resolved asap. We are basically on halt until this is resolved! Glad we are not the only ones reporting it though

    • gopster1283's avatar
      gopster1283
      Occasional Contributor

      We suspect the memory leak is also coming from the intellisence feature of TestComplete.

        if the leak happens during script development :

         @ Turn this off and you will notice a slight reduction in the leak.

         @ During development, manually create an error and have the script debugger show that error. Continue writing yourcode.

              memory leak should be reduced as well.

         if the leak happens during execution :

         @ Update to the latest 11.31. At least for python, execution memory leak has been significantly reduced. Not removed, but

              reduced.

       

      Other tips:

      1. minimize logging to 10 log files

      2. Run from Project items instead from the IDE

       

       

       

      • Manfred_F's avatar
        Manfred_F
        Regular Contributor

        Thank You for the info. Trying 11.31 would be nice, but my maintenance expired, so I have to stick to 11.20 :-(

         

        I load up two Memory usage diagrams. Both reflect the same test, the first after starting the System and TC, the second is for re-running the test with TC open.

        Memory usage only knows one way: up.

         

        There is one more curiosity occurring during "Long" test runs (> 1h):

        Sometimes the Access to the Control's SystemMenu property seems to be lost, Control.SystemMenu does no more get me a valid object. Maybe this is related somehow to loosing Memory?