WIM script crash in XP

G

Guest

First, let me say that I am not a Windows system or network administrator,
but a software tool developer supporting software development productivity
utilities used at my employment. I help maintain a home-grown automated test
management system used to run testcases to measure the quality of our
application, which is a CAD optical design package, that is developed here.
We run hundreds of testcases every night to validate recent changes to the
software application on various Windows platforms. To measure memory usage,
we use a Visual Basic script that utilizes Windows Management Instrumentation
(WIM) objects to launch the application process and to record memory usage of
the process when it is executing.

This script has been functionally successfully until we started running our
tests on Windows XP SP2. On this platform, about a dozen or so testcases hang
with a memory exception application crash. This works successfully if launch
directly without going through the VB script. It also works the Windows 2000
platform when using the script.

I have tried various ways to determine what could be the cause of the crash
on XP SP2. I disable the software Data Execution Prevention feature on the XP
hosts, but this did not resolve the problem.

It appears like the application crashes when commit memory charge reaches a
threshold of approximately 510MB. Total system RAM is 1G. As an experiment,
I configured virtual memory to 4G, which is the maximum setting. This causes
all but 3 testcase runs to complete successfully. The 3 testcases that still
crash are all graphical-intensive and consume the most memory. On a Windows
2000 machine, with the standard virtual memory to the default 1.5G, all tests
complete successfully.

Below is the snippet of the code that spawns the application process using
WMI objects calls (it was directly taken from MSDN examples). All I have
determined is that there is some correlation to virtual memory, but I do not
understand how and why XP would require substantial more memory resources
than Win2000 for executing a Visual Basic WIM script. My hope is that
someone more knowledgeable in Windows XP and/or WIM scripting can offer some
information and suggestions as to what is might be causing the problem
described here. Thanks in advance for your help.

' CreateProcess.vbs - taken from
' http://www.serverwatch.com/tutorials/article.php/1476821
'
' Usage (using notepad as an example):
' cscript CreateProcess.vbs "notepad"

set args = WScript.Arguments
num = args.Count
if num = 0 then
Wscript.StdOut.Writeline "Usage: [CScript|WScript] CreateProcess.vbs
arguments"
WScript.Quit 1
end if

Dim sComputer 'computer name
Dim sCmdLine 'command line of the process
Dim sCurDir 'working directory of the process
Dim oProcess 'object representing the Win32_Process class
Dim oMethod 'object representing the Create method

Dim oInPar 'object representing input parameters of the method
Dim oOutPar 'object representing output parameters of the method

sComputer = "."
sCmdLine = ""

For i = 0 to num - 1
sCmdLine = sCmdLine & WScript.Arguments(i) & " "
Next

Wscript.StdOut.Writeline "sCmdLine = " & sCmdLine

'Set our current directory to where we executed the script
Set objShell = CreateObject("WScript.Shell")
sCurDir = objShell.CurrentDirectory
sCurDir = sCurDir
Wscript.StdOut.Writeline "sCurDir = " & sCurDir

Set oProcess = GetObject("winmgmts://" & sComputer & _
"/root/cimv2:Win32_Process")
Set oMethod = oProcess.Methods_("Create")
Set oInPar = oMethod.inParameters.SpawnInstance_()
oInPar.CommandLine = sCmdLine
oInPar.CurrentDirectory = sCurDir
Set oOutPar = oProcess.ExecMethod_("Create", oInPar)

If oOutPar.ReturnValue = 0 Then
WScript.Echo "Create process method completed successfully"
WScript.Echo "New Process ID is " & oOutPar.ProcessId
Else
WScript.Echo "Create process method failed"
End If
 
D

David H. Lipman

From: "george_in_california" <[email protected]>

| First, let me say that I am not a Windows system or network administrator,
| but a software tool developer supporting software development productivity
| utilities used at my employment. I help maintain a home-grown automated test
| management system used to run testcases to measure the quality of our
| application, which is a CAD optical design package, that is developed here.
| We run hundreds of testcases every night to validate recent changes to the
| software application on various Windows platforms. To measure memory usage,
| we use a Visual Basic script that utilizes Windows Management Instrumentation
| (WIM) objects to launch the application process and to record memory usage of
| the process when it is executing.
|
< snip >

Wrong News Group for WMI (not WIM) !

You want; microsoft.public.win32.programmer.wmi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top