FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18036&edit=1

ID: 18036
Updated by: kvz@php.net
Reported By: kkszysiu at gmail dot com
Summary: Memleak in System_Daemon::info()
-Status: Open
+Status: Closed
Type: Bug
Package: System_Daemon
Operating System: Linux
Package Version: 0.10.3
PHP Version: 5.2.6
-Assigned To:
+Assigned To: kvz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: kvz
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.

http://stackoverflow.com/questions/4113776/php-daemon-possible-memory-
leak/4132951#4132951


Previous Comments:
------------------------------------------------------------------------

[2010-11-09 12:02:57] kkszysiu

Description:
------------
Hello.
I'm using System_Daemon to demonise our php scipts but we're suffering
on regular crashes caused by PHP fatals - "Allowed memory size of
134217728 bytes exhausted (tried to allocate 1572868 bytes)". I checked
that using simple script attached do that bug report and it seems that
your logging functions are fault of that memleak.

More about it:
http://stackoverflow.com/questions/4113776/php-daemon-possible-memory-leak/4125427#4125427

Test script:
---------------
#!/usr/bin/php -q

<?php
require_once "System/Daemon.php";
System_Daemon::setOption("appName", "smsd");
System_Daemon::start();
while(!System_Daemon::isDying()) {
System_Daemon::info("debug: memory_get_peak_usage:
".memory_get_peak_usage()."\n");
System_Daemon::info("debug: memory_get_usage:
".memory_get_usage()."\n\n");
System_Daemon::iterate(2);

}


Expected result:
----------------
Well, memory_get_peak_usage should not growing. When we use "print"
function from PHP it works well but with System_Daemon::info() memory
usage is growing fast.

Actual result:
--------------
[Nov 08 16:46:00] info: debug: memory_get_peak_usage: 999304
[Nov 08 16:46:00] info: debug: memory_get_usage: 934564
[Nov 08 16:46:02] info: debug: memory_get_peak_usage: 999400
[Nov 08 16:46:02] info: debug: memory_get_usage: 934564
[Nov 08 16:46:04] info: debug: memory_get_peak_usage: 999496
[Nov 08 16:46:04] info: debug: memory_get_usage: 934564
[Nov 08 16:46:06] info: debug: memory_get_peak_usage: 999592
[Nov 08 16:46:06] info: debug: memory_get_usage: 934564
[Nov 08 16:46:08] info: debug: memory_get_peak_usage: 999688
[Nov 08 16:46:08] info: debug: memory_get_usage: 934564
[Nov 08 16:46:10] info: debug: memory_get_peak_usage: 999784
[Nov 08 16:46:10] info: debug: memory_get_usage: 934564
[Nov 08 16:46:12] info: debug: memory_get_peak_usage: 999880
[Nov 08 16:46:12] info: debug: memory_get_usage: 934564
[Nov 08 16:46:14] info: debug: memory_get_peak_usage: 999976
[Nov 08 16:46:14] info: debug: memory_get_usage: 934564
[Nov 08 16:46:16] info: debug: memory_get_peak_usage: 1000072
[Nov 08 16:46:16] info: debug: memory_get_usage: 934564
[Nov 08 16:46:18] info: debug: memory_get_peak_usage: 1000168
[Nov 08 16:46:18] info: debug: memory_get_usage: 934564
[Nov 08 16:46:20] info: debug: memory_get_peak_usage: 1000264
[Nov 08 16:46:20] info: debug: memory_get_usage: 934564
[Nov 08 16:46:22] info: debug: memory_get_peak_usage: 1000360
[Nov 08 16:46:22] info: debug: memory_get_usage: 934564
(...)

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 9, '10 at 11:11a
activeNov 9, '10 at 11:11a
posts1
users1
websitepear.php.net

1 user in discussion

Kvz: 1 post

People

Translate

site design / logo © 2022 Grokbase