Re: Re: Allowed memory size of

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <b2winter@xxxxxxxxx> 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 Megabytes<br />";
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 134217728>69505726. 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux