Is there a solution for possible memory leak?
- This topic has 5 replies, 2 voices, and was last updated 8 years, 5 months ago by Curtis Don.
-
AuthorPosts
-
August 30, 2015 at 3:03 pm #30702Curtis DonParticipant
Hello Zap,
We use ZAPTEST and have a drive test with multiple RunTest calls in it:
We are getting System.OutOfMemory Exception was thrown constantly. We are running many tests in succession, but we NEED to do that. Any ideas on how to prevent this? I tried running %windir%system32rundll32.exe advapi32.dll,ProcessIdleTasks, but it doesn’t appear to work. Need a clue on this one!Thanks.
August 30, 2015 at 3:08 pm #30703Sasha ZAPModeratorHello CurtisDo,
Thank-you for your question.
Basically you have to know there is no functional testing tool which can run without exiting it at some point of time, each running of such tools use amount of memory which its free depends on ending the tool’s process, meaning exiting it eventually;
Plus, the actual AUT (Application Under Test) which ZAPTEST needs to reopen each time it executes its business processes, although I believe in your testing script it eventually logout but then login back for the next iteration which means the memory is still being used each login to the AUT and also its capacity is being increased due to business processes needs.Based on the above there is a serious problem of freeing memory if you run any testing tool and the AUT for a long period of time, and because of this problem sometimes the “Out of memory” message appears in ZAPTEST:
Therefore I believe the best way to overcome this issue is to run ZAPTEST for less amount of time, and make sure between every several runs ZAPTEST will be completely restarted (Including closing its process) and same thing regarding the tested AUT.I believe there is a possibility to make the above somewhat an automatic process, but it may never be 100% free of problems (The ZAPTETAUT memory may not get free as expected if the applications will have closing difficulties, and because the process is automatic we will not have control on it during it run phase).
To make it automatic you can try to do the following:
You can use such utilities as the MS Windows’ “Task Scheduler” to execute ZAPTEST and to make sure both ZAPTEST and the AUT processes will be closed after several runs, this you can do by executing a small VBS files such as the following from within the MS Windows’ “Task Scheduler”:
Save the folowing script into a text file, name it as “Execution” and change its suffix from “txt” to “vbs” (Change the “Your Test Name” to the actual test you want to execute):
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run “C:Your Test Name.zap”
WshShell.AppActivate “ZAPTEST”
WScript.Sleep 5000
WshShell.SendKeys “{F5}”Save the following script into a text file, “name it as “End Process” and change its suffix from “txt” to “vbs” (Change the “Process Name” to the actual process name you want to end):
Dim blnRunning, colProcesses, objProcess, myProcess
myProcess = “Process Name”
blnRunning = False
Set colProcesses = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery( “Select * From Win32_Process”, , 48 )
For Each objProcess in colProcesses
If LCase( myProcess ) = LCase( objProcess.Name ) Then
myProcess = objProcess.Name
objProcess.Terminate()
End If
Next
If blnRunning Then
Do Until Not blnRunning
Set colProcesses = GetObject(“winmgmts:{impersonationLevel=impersonate}”).ExecQuery( “Select * From Win32_Process Where Name = ‘”& myProcess & “‘” )
WScript.Sleep 100 ‘Wait for 100 MilliSeconds
If colProcesses.Count = 0 Then ‘If no more processes are running, exit loop
blnRunning = False
End If
Loop
End IfBoth the above scripts can be used on different applications, such as ZAPTEST and all of your AUTs, rename the above scripts according to the app it handles, each script handles a single app.
Hope this will give you more automatic control upon the ZAPTEST tests’ executions, but you have to remember the basic fact:
In order to have memory you must first free memory, and the best way to do it is by ending processes running in the OS background.Please contact Zap for further help.
Thanks,
SashaAugust 30, 2015 at 3:11 pm #30704Curtis DonParticipantThank-you Sasha, the latest version does fix this problem!! great!
July 26, 2016 at 5:45 pm #30887Sasha ZAPModeratorHello again CurtisDo,
The latest ZAPTEST versions do not have any memory leaks no more:
Please download the latest version from ZAP portal (Or request for the newest version) and you will not have this issue no more.Please contact ZAP for further help.
Thanks,
SashaJuly 26, 2016 at 8:51 pm #30889Sasha ZAPModeratorHello Curtis,
This issue was fixed in v15.1.40. Please download the latest version on our portal and re-install ZAPTEST.
Sincerely,
SashaJuly 26, 2016 at 8:52 pm #30890Curtis DonParticipantThank you Sasha, the latest version does fix this problem!! great!
-
AuthorPosts
- You must be logged in to reply to this topic.