Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28914 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36518 invoked by uid 1010); 18 Apr 2007 07:37:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36503 invoked from network); 18 Apr 2007 07:37:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2007 07:37:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=david.sklar@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=david.sklar@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.251 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: david.sklar@gmail.com X-Host-Fingerprint: 209.85.132.251 an-out-0708.google.com Received: from [209.85.132.251] ([209.85.132.251:45399] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/40-32576-6DAC5264 for ; Wed, 18 Apr 2007 03:37:59 -0400 Received: by an-out-0708.google.com with SMTP id c28so89241ana for ; Wed, 18 Apr 2007 00:37:56 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qFuC2RVZaUt1JRnd6Kl+bCgUGH9gHaNCwFXGzBDfchyaD+gzhUhWBIrbVDxByZZCBENcavPQ6PWLbMU83+IZevNSh7zHoIGsZGmOR9HVdR7xSgabfXFMzxi3VnPi//lAu5fnA616oKRuvh+/3HZMbwTRr9fy/XXcbXshkGrBFB4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FqAEqjr112WnLRQ/sryW+GHZSpIGrjy+vYrRxHrzEBcJlDexX0eGwEaI1SY6D6MocorvoeLaFyF36AIg10Yz0Me6C2vuWzeYA2t8bAJ8JKDgbLWLGjCOpceWX5I7g6hTg/J42XBOTpt6JGcUaBIdzaqVJM1LAwDfDldf+CB+h3Q= Received: by 10.100.126.2 with SMTP id y2mr132047anc.1176881875539; Wed, 18 Apr 2007 00:37:55 -0700 (PDT) Received: by 10.100.168.17 with HTTP; Wed, 18 Apr 2007 00:37:55 -0700 (PDT) Message-ID: <7cea347c0704180037o7485422ar8dc816a9c57fe352@mail.gmail.com> Date: Wed, 18 Apr 2007 09:37:55 +0200 To: internals@lists.php.net In-Reply-To: <3293.209.254.223.2.1176846979.squirrel@www.l-i-e.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7cea347c0704160319x619b26d0s7716e35493e122c4@mail.gmail.com> <4623BDF4.8010005@zend.com> <7cea347c0704170116j3ba50dbbrd7cc36780ead7164@mail.gmail.com> <3293.209.254.223.2.1176846979.squirrel@www.l-i-e.com> Subject: Re: [PHP-DEV] Trapping "memory exhausted" error From: david.sklar@gmail.com ("David Sklar") On 4/17/07, Richard Lynch wrote: > On Tue, April 17, 2007 3:16 am, David Sklar wrote: > > Richard Lynch wrote: > >> You might also come at it from the other direction and detect/notify > >> at some number smaller than the current hard limit, configurable in > >> php.ini... > >> > >> This might play better with anything relying on the current > >> behaviour > > > > This is interesting and might actually take care of a lot of cases. I > > don't know enough about the existing memory manager to know if it > > would handle the case where a single new allocation would blow through > > both the (lower) soft limit and the hard limit at the same time. > > If an allocation blows through the hard limit, it should behave > exactly as it does now, for BC, imho. > > If you let the developer decide on a "soft limit" or a percentage of > the "hard limit" where some callback function happens, it's on their > heads if they do something silly that rips right past their selected > soft/hard limits. Well, the BC case could be handled by doing what you suggest if the "grace limit" config option isn't defined. I think it's important, in the case that the grace limit is set up, to trigger its behavior even if a single allocation blows away both so that the recovery can be graceful. For example, if you're retrieving a feed to parse or the contents of a file and that feed or file is unexpectedly large so it blows through both memory limits. David