Forum Discussion

anmoldabra's avatar
anmoldabra
Occasional Contributor
9 years ago

TestComplete 11.0 - Memory Issue

Environment Details:

Windows 7, 64 Bit, 8 GB RAM
TestComplete 11.0

 

Project Details:

Used NameMapping Approach

Defined All object references in one script file as Global Variables.
There are 3000+ Variables.

Reading and Writing Data from Excels

 

Problem:

When i open my project. RAM usage is 320-340 MB

When i run any of my test function RAM usage will increase to 450-500 MB
If i keep on running test functions RAM usage will increase to 800+ MB

This is making my test execution go slow and crashing application under test.

Anybody faced this kind of issue ?

Why RAM usage will be increasing every time ?

Is there any memory leakage ?

Why after execution RAM usage is not coming to normal ?

  • william_roe's avatar
    william_roe
    Super Contributor

    I've added steps to logout out of the application, close and re-open the browser and login into the app prior to the point the memory causes to the test to crash and this seems to work.. This workaround allows the test complete. I've opened numerous tickets the memory problem.

  • william_roe's avatar
    william_roe
    Super Contributor

    We are using name mapping on a 64-bit machine with 16GB of running TC 11.30. We are unable to run our entire test suite without before tcHost.exe usage grows to 1.9gb and TC locks up. If a few items are disabled the test will run all they way through. I've nearly reached the end of the road here.

    • dganov's avatar
      dganov
      Staff

      william_roe, you wrote: "We are unable to run our entire test suite without before tcHost.exe usage grows to 1.9gb and TC locks up". I am curious what is tcHost.exe? I failed to find it in my TestComplete folder.

      • william_roe's avatar
        william_roe
        Super Contributor

        dganov wrote:

        william_roe, you wrote: "We are unable to run our entire test suite without before tcHost.exe usage grows to 1.9gb and TC locks up". I am curious what is tcHost.exe? I failed to find it in my TestComplete folder.


        tcHost is a process spun up in memory when TC is running. We get somewhat frequent crashes from this process.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        It's been a while since I've run into problems like this.  However, IIRC, part of it has to do with how much information you're writing out to your test log. If you're calling Log.Message for every little thing or if you're not using Log.LockEvents in your code, I think that a good bit of what you might be dealing with is that TC has to store a lot of the logging information in memory.  Take a look at optimizing your utilization of the logging, reduce the number of messages, and make sure that Log.LockEvents is in place to prevent too much information being written out.

  • Defined All object references in one script file as Global Variables.
    There are 3000+ Variables.

     


     

    What is the purpose of doing this? It probably isn't causing the memory issue you're facing, but it seems redundant and unnecessary if you know how to use NameMapping properly.

     

     

    As for the memory issue, can't say I have the exact same problem as you, but I used to notice TestComplete would use more and more RAM if I was using it over the course of a day or two without restarting it. I eventually came to realize that the SQL DB connections I was opening weren't always being closed because the test script would sometimes be interrupted and the code to close the connection wouldn't be executed. So if you are opening DB connections or files or anything else that could lead to a resource leak I'd suggest trying to make your code more robust to ensure any open resources are closed. I used the OnStopTest event to close any open connection I might have.