Bug #15485 Updated: memory ressource with socket_read()
| From: | sniper@php.net | Date: | Fri, 07 Jun 2002 20:47:03 +0000 |
| Subject: | Bug #15485 Updated: memory ressource with socket_read() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9796@lists.php.net to get a copy of this message | ||
ID: 15485
Updated by: sniper@php.net
Reported By: bool@nexenservices.com
Status: Feedback
-Bug Type: Performance problem
+Bug Type: Sockets related
Operating System: Windows 2000 Pro
PHP Version: 4.1.0
New Comment:
reclassified where this belongs..
Previous Comments:
------------------------------------------------------------------------
[2002-06-07 14:32:00] grangeway2@hotmail.com
no output after php terminates. the script is as follows:
<?
error_reporting (E_NONE);
$socket = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);
$moo = socket_connect ($socket, "www.php.net", "80");
if ($moo)
{
socket_set_nonblock ($socket);
while ($i<2000000) {
$i++;
if (($buf = socket_read($socket, 1024)) !== FALSE ) {
$buf = NULL;
unset($buf);
}
}
}
?>
(add a sleep(1) into the while loop and it's fine...)
------------------------------------------------------------------------
[2002-06-07 13:52:09] mfischer@php.net
Please test against http://snaps.php.net/php4-latest.tar.gz, compile
with --enable-debug and if the extension really leaks memory please
paste the output after php ends (you will get a leak list [kind of] if
there's really a leak).
------------------------------------------------------------------------
[2002-06-07 13:47:06] grangeway2@hotmail.com
socket_set_nonblock ($socket);
while (1) {
sleep(1);
if (($buf = socket_read($socket, 1024)) !== FALSE ) {
$buf = NULL;
unset($buf);
}
}
--> that code works fine.
As the original reporter says, if you remove sleep(1) it leaks memory.
Approximately 1Mb of memory every few seoncds here.
This is against 4.2.1
------------------------------------------------------------------------
[2002-06-05 01:00:06] php-bugs@lists.php.net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-05-04 19:06:58] mfischer@php.net
Please try current CVS HEAD and report back.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15485
--
Edit this bug report at http://bugs.php.net/?id=15485&edit=1