Forum Discussion

rkhashab's avatar
rkhashab
New Contributor
14 years ago

How do you free a variable

Hi,

We have a memory leak that is caused by the following code:



tmpStr := DLL.New('LPSTR',256);



How do I free up the tmpStr variable?



Thanks!

3 Replies

  • Hello Raya,


    Memory allocated to variables is freed up after the test run is over.

    Could you please provide a bit more detail on your memory leak problem? How do you detect a memory leak? Does TestComplete display any error message notifying that it runs out of memory?


    Thank you.

  • rkhashab's avatar
    rkhashab
    New Contributor
    Thanks Julia! we detected the memory leak by noticing tcHostingProcess.exe's size was growing to 800+K and then the script started to slow then eventually it crashes. When we debugged the script every time it hit the new variable line tcHostingProcess.exe's size incremented.
  • Raya,

    We would like to investigate the behavior you describe more closely. Could you please post your entire code here?

    Thank you.