php-windows Digest 10 Sep 2007 01:54:49 -0000 Issue 3326

Topics (messages 28458 through 28460):

Re: showing warnings
        28458 by: John Mertic

Memory leak occurs when exec() function is used on Windows platform
        28459 by: melmack
        28460 by: Elizabeth Smith

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Can you provide the script you are running and the exact error message
you are getting?

John

On 9/9/07, Asim <[EMAIL PROTECTED]> wrote:
> Hi
>
>
>   in my script when i scan whole table for result set to display in my page 
> it shows warning that suggest me to use
>
>
>   EXPLAIN statement but i donot need it as i have to show records on page
>
>   how to avoid this warning?
>
>   Bye
>
>
>
>
>
>
>
>
> Asim Jamil  - 0092 345 4025907, Pakistan
>
> ---------------------------------
> Be a better Globetrotter. Get better travel answers from someone who knows.
> Yahoo! Answers - Check it out.


-- 
-- 
John Mertic                                        "Explaining a joke
is like dissecting a frog: you
[EMAIL PROTECTED]                              understand it better,
but the frog dies in the
                                                          process."

                      -Mark Twain

--- End Message ---
--- Begin Message ---
Hi

I have a big problem with shell commands execution via PHP.
I have written a very short PHP script ilustrating the problem:


<?php


for($i=0;$i<1000;$i++)
{ 
  exec("test.bat"); 



} 


?> 

test.bat is just an empty file. 


This script causes about 10 MB memory leak. It can be observed 
by usage of performance system monitor. This problems occurs in 
all available enviroments: 
- IIS Webserver. 
- Apache webserver 
- PHP command line interpreter 


Memory leak is observable only on Windows platform 
(tested on Windows XP). On Linux everything works OK. 


Does someone know how to solve this problem? Any help appreciated 


Best regards 
Melmack 

--- End Message ---
--- Begin Message ---
melmack wrote:
Hi

I have a big problem with shell commands execution via PHP.
I have written a very short PHP script ilustrating the problem:


<?php


for($i=0;$i<1000;$i++)
{ exec("test.bat");


}

?> test.bat is just an empty file.

This script causes about 10 MB memory leak. It can be observed by usage of performance system monitor. This problems occurs in all available enviroments: - IIS Webserver. - Apache webserver - PHP command line interpreter

Memory leak is observable only on Windows platform (tested on Windows XP). On Linux everything works OK.

Does someone know how to solve this problem? Any help appreciated

Best regards Melmack

I've found exec to be flaky enough on windows that instead I use com to spawn the new process.

$shell = new COM('WScript.Shell');
$return = $shell->Run($cmd, 0, false);
unset ($shell);

Faster and no leaks ;) Only downside is you have to wrap cross-platform code with windows detection.
--- End Message ---

Reply via email to