You are here: Re: Allowed memory size of « PHP « IT news, forums, messages
Re: Allowed memory size of

Posted by Bob Winter on 06/20/05 17:46

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация