ID: 42509
Updated by: [EMAIL PROTECTED]
Reported By: thomas dot hebinck at digionline dot de
-Status: Open
+Status: Assigned
Bug Type: Math related
Operating System: Linux
PHP Version: 5.2.4
-Assigned To:
+Assigned To: stas
New Comment:
[EMAIL PROTECTED] php_5_2]$ sapi/cli/php t.php
79768
99792024
[EMAIL PROTECTED] php_5_2]$ USE_ZEND_ALLOC=0 sapi/cli/php t.php
8236
8236
Previous Comments:
------------------------------------------------------------------------
[2007-09-01 17:02:26] thomas dot hebinck at digionline dot de
Description:
------------
Various GMP Functions eat memory, when not called directly with
integers or strings instead of gmp resources.
Reproduce code:
---------------
$a='1234';
for($i=0;$i<200000;$i++) {
$c=gmp_add(gmp_init($a),gmp_init($a));
}
echo memory_get_usage() . "¶\n";
for($i=0;$i<200000;$i++) {
$c=gmp_add($a,$a);
}
echo memory_get_usage() . "¶\n";
Expected result:
----------------
Both memory_get_usage() should show nearly the same values.
Actual result:
--------------
1732656¶ // ~ 2 MB
43809696¶ // ~ 43 MB
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42509&edit=1