Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107313 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81384 invoked from network); 24 Sep 2019 19:02:43 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 24 Sep 2019 19:02:43 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 9B9AD2CFA0E for ; Tue, 24 Sep 2019 09:41:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Tue, 24 Sep 2019 09:41:37 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id q15so1213649pll.11 for ; Tue, 24 Sep 2019 09:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Ur60zZRHY97lGpmxkVxfudg0n/07jOxZGAr0n/VzbY=; b=sA7VuSdCnK1tLc8mN50cK6B5U6VC9JmNifl1S+oysL2IQEY7ZUdRFpiGbhoTnu94Yu bGOQ8+5TBa2jxPIMNtgGByt21Rlc2lVmfYK1f9mAWoA73gyVTJP10D16+nss5wzaWK3+ EM8X3rcwwhC8iFOc4rT7XpEyPNwTZ/iB+NPFpYo4wfIPbzYW1j1uTt+0Go/Teph0+Adj co8EMUJoLafFtF/C2WXsW3NsiD3ttY/Hqfr3r+VotJkmKZjinz1C/LwsJAr16l6/sw8i mChUA06BNPxjaoLjGzSuWOv6MjWyrkF+xlMOncQAGHxk8bG06d5PiFTqlhNpPrECxQMM mHBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Ur60zZRHY97lGpmxkVxfudg0n/07jOxZGAr0n/VzbY=; b=A+15yHBpkEUqe0au478GxJdQfVzRkq3OSQ2wNTx0yM4NGTT6DMFRj+xhiahZwQBwCe AKsBjen0l47Yara1zox6aLieayyBqbgGQSACseTTA/S7XNMSqFwKZ7SNSyGUZYpT7pEa U9Q/sRcqsDtwwiU1SBgioz81ofLNS6zOATHxDNq9Dx7B9FdDcsC9LWNL3bLZ9XxVTuu0 MBCdhDxcmAGKD5tfm0D0ox/V3znFEMdZg8kvxWb4uDqLu34Wi/fyPzqIfSbPCOUM1Bf4 NoUp1UaAoDkK94n6zo28RssqY/L2tqlAHM/PFB5LdwrVMai7JQzbOoo7TzNk3E5vIqzB EHmw== X-Gm-Message-State: APjAAAXo6sFhiZBiMCHiRlRCRmsG8BCa6Rmr6nh+8FefSi5JXOj2qI3o D2vu5URHbro7vp3BSokcyhIjmHlJoNYHOdy4KmC2lA== X-Google-Smtp-Source: APXvYqzA0xsxyYVKxVVkjdvXvkkAhyO+7Rnyz7MWPlhDwdzK6qstgLE3s00Jr60UjYQ3SqbJxrvfMEC3INBRzaH6vRg= X-Received: by 2002:a17:902:b288:: with SMTP id u8mr3921852plr.127.1569343296460; Tue, 24 Sep 2019 09:41:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 24 Sep 2019 17:41:25 +0100 Message-ID: To: Peter Stalman Cc: "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" X-Envelope-From: Subject: Re: [PHP-DEV] Shutdown Memory Allowance (aka Soft Memory Limit) From: Danack@basereality.com (Dan Ackroyd) On Tue, 24 Sep 2019 at 07:26, Peter Stalman wrote: > > So I would like to suggest an option for setting a shutdown memory allowance, > which would be the amount of additional memory allowed to be used by any > registered error handlers or shutdown functions. I can see the need, and what problem you're trying to solve. I think focusing on 'memory to be used by shutdown handlers' is slightly more specific than a solution needs to be. Just expressing it as, when PHP fails to allocate some memory due to reaching the limit then: * Increase the memory limit by an ini setting defined amount. This only happens once per request/process. * Throw an EngineException. should cover what you want to do, without tying the solution to where that memory can be used. One of the reasons I haven't submitted an RFC for that already is that I'm not sure what would be involved in making sure it was safe to throw an exception from places where the memory allocation could fail. FYI possibly of interest, I did some investigation of a related feature a while ago, allowing people to trigger callbacks when the memory limit was reached: https://github.com/Danack/MemTrigger which is terribly out of date and a bad approach anyway, due to the performance hit, and people only really caring about hitting the memory limit. cheers Dan Ack