Re: [PHP] Re: Allowed memory size of
Bob I try to run your test script. So before the file reading the memory is 125730 o, and I 'm not able to get the next text due to error display CURRENT MEMORY USAGE = 125720 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I tried to set the memory_limit in the script and set a default value more efficient in the php.ini That show the same error. Thanks for your helps david Le Mon, 20 Jun 2005 16:46:36 +0200, Bob Winter [EMAIL PROTECTED] a écrit: David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, in several places if necessary, it should help you debug it .// PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-usage.php print 'CURRENT MEMORY USAGE = '.memory_get_usage().'br /'; // PRINT CURRENT MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-get.php print 'MEMORY LIMIT = '.ini_get('memory_limit').'br /'; You can also set the memory limit on a per page basis // SET MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-set.php $mem_limit = '128'; print SETTING MEMORY LIMIT TO $mem_limit Megabytesbr /; ini_set('memory_limit', $mem_limit.'M'); //http://us4.php.net/manual/en/ini.core.php#ini.memory-limit There are a variety of limitations and restrictions to the commands noted above, be sure to read the documentation. -- Bob david forums wrote: Hello I got the following message. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I read on several forums to increase the size of the memory limit in php.ini. As you can wee which as already be done cause 13421772869505726. But I still get the message. I'll like to understand and find how to do. The aim of this script is to get a big file (69MB) and to encrypt (using mcrypt). then to send it by ftp. Thanks for your helps david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Allowed memory size of
David I don't have a definitive answer for you, but I notice that the memory size is less than twice the file size. Depending on the PHP functions you are using you could be eating up a lot of memory in the execution of the script that wouldn't necessary show up where you inserted the debugging statements. Does the script work with smaller files? Can you the memory_limit to something very high, over 220 Mb, and/or test your script with smaller files to find the threshold where the Fatal error occurs? -- Bob david forums wrote: Bob I try to run your test script. So before the file reading the memory is 125730 o, and I 'm not able to get the next text due to error display CURRENT MEMORY USAGE = 125720 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I tried to set the memory_limit in the script and set a default value more efficient in the php.ini That show the same error. Thanks for your helps david Le Mon, 20 Jun 2005 16:46:36 +0200, Bob Winter [EMAIL PROTECTED] a écrit: David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, in several places if necessary, it should help you debug it .// PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-usage.php print 'CURRENT MEMORY USAGE = '.memory_get_usage().'br /'; // PRINT CURRENT MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-get.php print 'MEMORY LIMIT = '.ini_get('memory_limit').'br /'; You can also set the memory limit on a per page basis // SET MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-set.php $mem_limit = '128'; print SETTING MEMORY LIMIT TO $mem_limit Megabytesbr /; ini_set('memory_limit', $mem_limit.'M'); //http://us4.php.net/manual/en/ini.core.php#ini.memory-limit There are a variety of limitations and restrictions to the commands noted above, be sure to read the documentation. -- Bob david forums wrote: Hello I got the following message. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I read on several forums to increase the size of the memory limit in php.ini. As you can wee which as already be done cause 13421772869505726. But I still get the message. I'll like to understand and find how to do. The aim of this script is to get a big file (69MB) and to encrypt (using mcrypt). then to send it by ftp. Thanks for your helps david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Allowed memory size of
I did it IT works with 256M memory allocated. After realising the line it shown 69505726(little more )Mo as memory usage. It's in some way really not understandable. I suppose it could be a php bug. tx david Le Tue, 21 Jun 2005 16:35:20 +0200, Bob Winter [EMAIL PROTECTED] a écrit: David I don't have a definitive answer for you, but I notice that the memory size is less than twice the file size. Depending on the PHP functions you are using you could be eating up a lot of memory in the execution of the script that wouldn't necessary show up where you inserted the debugging statements. Does the script work with smaller files? Can you the memory_limit to something very high, over 220 Mb, and/or test your script with smaller files to find the threshold where the Fatal error occurs? -- Bob david forums wrote: Bob I try to run your test script. So before the file reading the memory is 125730 o, and I 'm not able to get the next text due to error display CURRENT MEMORY USAGE = 125720 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I tried to set the memory_limit in the script and set a default value more efficient in the php.ini That show the same error. Thanks for your helps david Le Mon, 20 Jun 2005 16:46:36 +0200, Bob Winter [EMAIL PROTECTED] a écrit: David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, in several places if necessary, it should help you debug it .// PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-usage.php print 'CURRENT MEMORY USAGE = '.memory_get_usage().'br /'; // PRINT CURRENT MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-get.php print 'MEMORY LIMIT = '.ini_get('memory_limit').'br /'; You can also set the memory limit on a per page basis // SET MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-set.php $mem_limit = '128'; print SETTING MEMORY LIMIT TO $mem_limit Megabytesbr /; ini_set('memory_limit', $mem_limit.'M'); //http://us4.php.net/manual/en/ini.core.php#ini.memory-limit There are a variety of limitations and restrictions to the commands noted above, be sure to read the documentation. -- Bob david forums wrote: Hello I got the following message. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I read on several forums to increase the size of the memory limit in php.ini. As you can wee which as already be done cause 13421772869505726. But I still get the message. I'll like to understand and find how to do. The aim of this script is to get a big file (69MB) and to encrypt (using mcrypt). then to send it by ftp. Thanks for your helps david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Allowed memory size of
David, I don't believe this to be a bug. In order to process the script, PHP needs to use additional memory resources. My guess is that while the original 69Mb file is loaded, the new encrypted file also needs to exist in memory. Glad you were able to find a solution. --Bob david forums wrote: I did it IT works with 256M memory allocated. After realising the line it shown 69505726(little more )Mo as memory usage. It's in some way really not understandable. I suppose it could be a php bug. tx david Le Tue, 21 Jun 2005 16:35:20 +0200, Bob Winter [EMAIL PROTECTED] a écrit: David I don't have a definitive answer for you, but I notice that the memory size is less than twice the file size. Depending on the PHP functions you are using you could be eating up a lot of memory in the execution of the script that wouldn't necessary show up where you inserted the debugging statements. Does the script work with smaller files? Can you the memory_limit to something very high, over 220 Mb, and/or test your script with smaller files to find the threshold where the Fatal error occurs? -- Bob david forums wrote: Bob I try to run your test script. So before the file reading the memory is 125730 o, and I 'm not able to get the next text due to error display CURRENT MEMORY USAGE = 125720 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I tried to set the memory_limit in the script and set a default value more efficient in the php.ini That show the same error. Thanks for your helps david Le Mon, 20 Jun 2005 16:46:36 +0200, Bob Winter [EMAIL PROTECTED] a écrit: David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, in several places if necessary, it should help you debug it .// PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-usage.php print 'CURRENT MEMORY USAGE = '.memory_get_usage().'br /'; // PRINT CURRENT MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-get.php print 'MEMORY LIMIT = '.ini_get('memory_limit').'br /'; You can also set the memory limit on a per page basis // SET MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-set.php $mem_limit = '128'; print SETTING MEMORY LIMIT TO $mem_limit Megabytesbr /; ini_set('memory_limit', $mem_limit.'M'); //http://us4.php.net/manual/en/ini.core.php#ini.memory-limit There are a variety of limitations and restrictions to the commands noted above, be sure to read the documentation. -- Bob david forums wrote: Hello I got the following message. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I read on several forums to increase the size of the memory limit in php.ini. As you can wee which as already be done cause 13421772869505726. But I still get the message. I'll like to understand and find how to do. The aim of this script is to get a big file (69MB) and to encrypt (using mcrypt). then to send it by ftp. Thanks for your helps david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Allowed memory size of
David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, in several places if necessary, it should help you debug it . // PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-usage.php print 'CURRENT MEMORY USAGE = '.memory_get_usage().'br /'; // PRINT CURRENT MEMORY LIMIT: http://us4.php.net/manual/en/function.ini-get.php print 'MEMORY LIMIT = '.ini_get('memory_limit').'br /'; You can also set the memory limit on a per page basis // SET MEMORY LIMIT:http://us4.php.net/manual/en/function.ini-set.php $mem_limit = '128'; print SETTING MEMORY LIMIT TO $mem_limit Megabytesbr /; ini_set('memory_limit', $mem_limit.'M'); //http://us4.php.net/manual/en/ini.core.php#ini.memory-limit There are a variety of limitations and restrictions to the commands noted above, be sure to read the documentation. -- Bob david forums wrote: Hello I got the following message. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 69505726 bytes) I read on several forums to increase the size of the memory limit in php.ini. As you can wee which as already be done cause 13421772869505726. But I still get the message. I'll like to understand and find how to do. The aim of this script is to get a big file (69MB) and to encrypt (using mcrypt). then to send it by ftp. Thanks for your helps david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: allowed memory size of
[EMAIL PROTECTED] (Mathias brito) wrote in news:[EMAIL PROTECTED]: Hello, I made a script that make a backup of the entire site with the PHPZip lib. It's works well with small sites, but when the size grow, i receive the following message: Fatal error: Allowed memory size of 1048680 bytes exhausted at (null):0 (tried to allocate 170685 bytes) in /srv/www/htdocs/zip/pclzip.lib.php on line 2386 What it mean, and what can i do to fix it... http://www.php.net/manual/en/configuration.directives.php and look for memory_limit -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php