From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QAkvt-000279-OX for garchives@archives.gentoo.org; Fri, 15 Apr 2011 15:27:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 45B081C078; Fri, 15 Apr 2011 15:26:20 +0000 (UTC) Received: from smtp5.mail.fcom.ch (smtp5.mail.fcom.ch [212.60.46.174]) by pigeon.gentoo.org (Postfix) with ESMTP id 0B2281C078 for ; Fri, 15 Apr 2011 15:26:19 +0000 (UTC) Received: from smtp5.mail.fcom.ch (localhost [127.0.0.1]) by smtp5 (Postfix) with ESMTP id C060420572 for ; Fri, 15 Apr 2011 17:26:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on smtp5.mail.fcom.ch X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_50,RCVD_IN_SORBS_DUL, RDNS_DYNAMIC,SPF_HELO_PASS autolearn=no version=3.2.5 Received: from dmj.nu (204-104-204-62-pool.cable.fcom.ch [62.204.104.204]) by smtp5 (Postfix) with ESMTP id AD819204DC for ; Fri, 15 Apr 2011 17:26:14 +0200 (CEST) Received: from queen.localnet (queen.dmj.nu [192.168.1.11]) by dmj.nu with ESMTP; Fri, 15 Apr 2011 17:26:13 +0200 id 00000000003E42F6.000000004DA86395.00007B2C From: Dan Johansson To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [OT] PHP memory problem Date: Fri, 15 Apr 2011 17:26:12 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.37-gentoo-r4; KDE/4.4.5; x86_64; ; ) References: <201104132042.49914.Dan.Johansson@dmj.nu> <4DA64A02.7030502@orlitzky.com> In-Reply-To: <4DA64A02.7030502@orlitzky.com> X-Face: &pU{afj:B4l63kI+Lqyk~Sy4/whF_tOpA+G|\c?XeMpAaD/vgsopla?wk%#wum)./P7PL+ m@q{~IZ-Abs^fx8~&y=';Hf|q0QJ9'$hDLY-]G]qZi%D*]t,~cIK7&COJ+PB%k]I>70nan P4a4b,C!8S}q!8f'$0uXtH2dm2:Vcq6?KWwe/=VBL],r+d[~tG.JjxUv8\|`j: X-message-flag: Using Microsoft software might be a security risk Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104151726.13176.Dan.Johansson@dmj.nu> X-AV-Checked: ClamAV using ClamSMTP X-Archives-Salt: X-Archives-Hash: 5c3112df148474d67201bc66e53cce45 On Thursday 14 April 2011 03.12:34 Michael Orlitzky wrote: > On 04/13/2011 02:42 PM, Dan Johansson wrote: > > I know this is Off-topic but I also know there are a lot of smart people > > "lurking" on this list. > > > > I have a PHP-script that does not run from a web-server but directly in a > > shell. When I run it I get the following error: > > > > # ./dj.php > > PHP Fatal error: Allowed memory size of 100663296 bytes exhausted (tried > > to allocate 104 bytes) in /usr/local/scripts/includes/dj.inc on line 79 > > Allowed memory size of 100663296 bytes exhausted (tried to allocate 24 > > bytes) > > > > My scripts starts with: > > #!/usr/bin/php > > > > > ini_set('memory_limit', '4192M'); > > > > include "dj.inc"; > > > > And in php.ini I have: > > memory_limit = 1G ; Maximum amount of memory a script may consume > > > > Why does PHP not honor my memory limits? > > I have set 1GB in php.ini and 4192MB (I know that is more then 1GB) and > > the scripts fails at 100663296 bytes (~ 96MB). I have also tried with > > other memory settings but I always end up with with the failure at > > ~96MB. The host has enough RAM (32GB) to support the script. > > > > Any suggestions on how to solve the issue (short of rewriting the script > > in C or C++)? > > The use of 'G' as a unit was only "recently" added, in PHP 5.1.0. Try > using 'M' instead, and multiplying by 1024. > > I would also suggest using a number under 4 gigabytes, as you risk > overflowing a 32-bit integer. Does '3072M' work? Thanks, that was it. Changing 4G to 4192M in pnp.ini did solve the issue. Regards, -- Dan Johansson, *************************************************** This message is printed on 100% recycled electrons! ***************************************************