Bug #15485 Updated: memory ressource with socket_read()
| From: | grangeway2 at hotmail dot com | Date: | Fri, 07 Jun 2002 17:47:07 +0000 |
| Subject: | Bug #15485 Updated: memory ressource with socket_read() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9784@lists.php.net to get a copy of this message | ||
ID: 15485
Updated by: grangeway2@hotmail.com
Reported By: bool@nexenservices.com
Status: No Feedback
Bug Type: Performance problem
Operating System: Windows 2000 Pro
PHP Version: 4.1.0
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2002-04-22 20:12:43] bool@nexenservices.com
I checked this code under linux, all works fine, and the memory usage
fastly stabilize. But under Win2k, with Php 4.2.0 it's always the same
thing.
------------------------------------------------------------------------
[2002-02-10 09:05:13] bool@nexenservices.com
Hello
I have a script (a bot, so it don't stop) wich connects to a server
with socket_read(). It blocking mode it's work perfectly, but not in
non-blocking mode : memory used by the function socket_read() seems to
doesn't be released by PHP engine after the call. But when I had a
sleep(1) just after the call, it's ok.
I tried with the Apache's Php module, and directly with the PHP
executable. It's the same pb.
I know it's an experimental function, but I think it's can help for
it's development.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15485&edit=1