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 <b2winter@xxxxxxxxx> 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 <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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php