From: [EMAIL PROTECTED]
Operating system: win2k
PHP version: 4CVS-2002-10-25
PHP Bug Type: COM related
Bug description: Com Performance/Memory issues
vbscript code:
wscript.echo now
For I = 1 To 3000
set
ru=GetObject("WinMgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_NetworkAdapterConfiguration")
set ru = nothing
Next
wscript.echo now
vbscript output:
C:\php\wmi>cscript wmi.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
26/10/2002 00:07:26
26/10/2002 00:08:16
php code:
$prof = new Profiler;
for ($i=0;$i<3000;$i++){
$prof->startTimer($i);
$Services = new COM("winmgmts:{impersonationLevel=impersonate}") or
die("glump");
$NetworkAdapterSet =
$Services->InstancesOf('Win32_NetworkAdapterConfiguration');
$NetworkAdapterSet->release();
$Services->release();
unset($Services);
unset($NetworkAdapterSet);
$prof->stopTimer($i);
}
php results:
C:\php\snaps\php4-win32-latest>php c:\php\wmi\wmiperf.php
Warning: (null)(): Invoke() failed: Exception occurred.
<b>Source</b>: SWbemServices <b>Description</b>: Generic failure
in c:\php\wmi\wmiperf.php on line 7
Fatal error: Call to a member function on a non-object in
c:\php\wmi\wmiperf.php
on line 8
doing it as 3 seperate runs yielded:
0-1000 runs: 11313.1239 ms (100.00 %) OVERALL TIME
1000-2000 runs: 23879.2120 ms (100.00 %) OVERALL TIME
2000-3000: 544210.0750 ms (100.00 %) OVERALL TIME
At the same time, memory utilization of winmgmt.exe rises to ~30mb from
the normal 4mb...
Looks like something isn't getting freed right...
--
Edit bug report at http://bugs.php.net/?id=20100&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20100&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20100&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20100&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20100&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20100&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20100&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20100&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20100&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20100&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20100&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20100&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20100&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20100&r=isapi