ID:               47022
 Comment by:       alan at binarystars dot com
 Reported By:      alan at binarystars dot com
 Status:           Feedback
 Bug Type:         IMAP related
 Operating System: linux
 PHP Version:      5.2.8
 New Comment:

I assume you mean if I enable Zend Memory. If you check the Old test 
run where USE_ZEND_ALLOC=1 you can see PHP is cleared the memory 
successfully after an unset.

http://home.binarystars.com/~alan/imap_bug/archive/method1_results.tx
t

However, the resident memory (RSS) remains high. Its almost like c-
client keeps the email data in memory without flushing the memory.

Again, this is a huge problem with systems that do not have a lot of 
free memory. Is there any way to flush the memory without exiting the 
script?


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

[2009-01-06 17:55:22] scott...@php.net

Check memory_get_usage() to see what PHP is using, my guess is that
there is a copy of the data in c-client and another for PHP. Immediately
after that line has executed I'm assuming the c-client version is
released.

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

[2009-01-06 16:32:54] alan at binarystars dot com

Description:
------------
Update of Bug 47000. I tried to update the bug report but wouldn't 
let me.

shell> php phpinfo.php | grep Configure
Configure Command =>  './configure'  '--with-mysql=/usr/local/mysql' 
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql-
sock=/tmp/mysql.sock' '--with-imap=/root/bin/imap-2007e' '--enable-
mbstring=all' '--enable-debug'

shell> export USE_ZEND_ALLOC=0

shell> export | grep ZEND
declare -x USE_ZEND_ALLOC="0"

shell> php -v
PHP 5.2.8 (cli) (built: Dec 20 2008 05:26:51)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

shell> uname -r
2.6.25-14.fc9.i686

shell> valgrind --tool=memcheck --num-callers=30 --leak-check=full --
log-file=imap_bug.log /usr/local/bin/php imap_bug.php

Old test run:
http://home.binarystars.com/~alan/imap_bug/archive/




Reproduce code:
---------------
Colorized imap_bug.html with line numbers:
http://home.binarystars.com/~alan/imap_bug/imap_bug.html (34k)

Text version:
http://home.binarystars.com/~alan/imap_bug/imap_bug.txt (3.6k)

Expected result:
----------------
See Bug 47000.
http://bugs.php.net/bug.php?id=47000




Actual result:
--------------
Method 1 results (w/ USE_ZEND_ALLOC=0):
http://home.binarystars.com/~alan/imap_bug/method1_results.txt (2.1k)

Method 2 results (w/ USE_ZEND_ALLOC=0): 
http://home.binarystars.com/~alan/imap_bug/method2_results.txt (2.1k)

Valgrind results (v3.4.0):
http://home.binarystars.com/~alan/imap_bug/imap_bug.log (2.4k)


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


-- 
Edit this bug report at http://bugs.php.net/?id=47022&edit=1

Reply via email to