Ask a Question related to PHP Development, Design and Development.
-
jay@php.net #1
#26042 [Fbk->Ver]: Memory usage
ID: 26042
Updated by: [email]jay@php.net[/email]
Reported By: vsv3 at alu dot ua dot es
-Status: Feedback
+Status: Verified
Bug Type: mcrypt related
Operating System: Linux 2.4.22 Debian Woody
PHP Version: 4.3.2
New Comment:
Looks like a leak starting in mcrypt_generic_init(). When
mcrypt_generic_init() is called from PHP userland, it
never gets deinit'd unless you explicitly call
mcrypt_generic_deinit().
Perhaps mcrypt_generic_init() should check to see if the
td has already been init'd and if so, deinit it first.
Haven't looked too closely at the libmcrypt source yet to
see the easiest way to do it.
This is using libmcrypt 2.5.7 and an up-to-date 4_3.
J
Previous Comments:
------------------------------------------------------------------------
[2003-10-30 13:50:21] [email]sniper@php.net[/email]
Please try using this CVS snapshot:
[url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]
For Windows:
[url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]
And if that doesn't help, give the mcrypt version you're using with
PHP.
------------------------------------------------------------------------
[2003-10-30 10:41:23] vsv3 at alu dot ua dot es
Description:
------------
When I use the functions for encrypt some data, the memory that PHP
uses, doesn't get free. It gets more and more memory.
Reproduce code:
---------------
<?php
$key = '123456789012345678901234567890';
$iv = '12345678';
$nVeces = 100000;
$n = 0;
$td = mcrypt_module_open( MCRYPT_BLOWFISH, '', MCRYPT_MODE_CBC, '' );
while( $n < $nVeces ) {
$fichero = file_get_contents( "/tmp/hola" );
mcrypt_generic_init( $td, $key, $iv );
$fichero_enc = addslashes( mcrypt_generic($td, $textoPlano) );
unset( $fichero_enc );
if( isset($fichero_enc) ) echo "<b><h1>No pudimos destruir la
variable</h1></b><br />";
$n = $n + 1;
}
mcrypt_module_close( $td );
?>
Expected result:
----------------
A script that execute with a consume of less than 1MB of memory (with a
file '/tmp/hola' of 1kB).
Actual result:
--------------
An script that consumes more than 100MB, or more. A similar script with
other data, have been consumed more than 2000MB.
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=26042&edit=1[/url]
jay@php.net Guest
-
#26042 [Ver->Csd]: Memory usage
ID: 26042 Updated by: iliaa@php.net Reported By: vsv3 at alu dot ua dot es -Status: Verified +Status: ... -
#26042 [Opn->Fbk]: Memory usage
ID: 26042 Updated by: sniper@php.net Reported By: vsv3 at alu dot ua dot es -Status: Open +Status: ... -
#26042 [NEW]: Memory usage
From: vsv3 at alu dot ua dot es Operating system: Linux 2.4.22 Debian Woody PHP version: 4.3.2 PHP Bug Type: mcrypt related... -
COM memory and CPU usage
i have installed a VB6 COM component in the Component Services of IIS 4.0. i'm not sure if it's been properly set-up. it keeps eating up huge... -
CPU and Memory usage
Hi How do I find CPU and memory usage for all process on a system over time? I would like to run such a script and write the result to a log...



Reply With Quote

