#16635 [Com]: dio_read() leaks memory
| From: | juha dot tuominen at tuotoi dot net | Date: | Sun, 03 Nov 2002 10:40:21 +0000 |
| Subject: | #16635 [Com]: dio_read() leaks memory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-23976@lists.php.net to get a copy of this message | ||
ID: 16635
Comment by: juha.tuominen@tuotoi.net
Reported By: Jorfen@web.de
Status: Closed
Bug Type: Unknown/Other Function
Operating System: x86/Linux
PHP Version: 4.2.0
Assigned To: sterling
New Comment:
I have the memory leaking problem with dio_read() as well. The PHP
versio I use is 4.2.2 with DirectIO extension in an embedded Linux box.
I have an X10 home automation software written with PHP and it runs as
a daemon. The serial port is configured to be non-blocking. I check if
there is any data available about 10 times a second (it's a busyloop
with usleep(100000) in it). The checking is done as follows:
$data=dio_read($fp,1);
After running the daemon for about 20 hours, I always get the following
error message:
Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to
allocate 2 bytes) in /mnt/data/plugins/X10/html/x10_wrapper.php on line
76
Line 76 is the one above with dio_read(). I would really need a fix for
this or I'm forced to write a nasty
kill-the-process-and-then-restart-it-again-just-to-make-it-stay-alive
piece of script to be ran by cron.
-Juha
Previous Comments:
------------------------------------------------------------------------
[2002-04-20 12:09:13] sterling@php.net
Cannot reproduce - this shouldn't happen.
------------------------------------------------------------------------
[2002-04-18 19:12:30] sniper@php.net
Assigned to Sterling who is the maintainer of this extension..
------------------------------------------------------------------------
[2002-04-16 11:11:28] Jorfen@web.de
I am using the RC4 of php4.2.0 with Apache/1.3.24 (Unix).
Every time dio_read() is called in a script, the htttpd process uses
more and more memory.
ex.:
$o = dio_read($fp,100000);
would let httpd grow by ca. x times of 100000.
unset($o) will not get the memory back. the httpd process would keep
its size until the script terminates.
Needing to call dio_read repeatidly makes it even worse. And using 1024
bytes blocks only slows the process of growing down.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16635&edit=1