Re: [PATCH] Raise warning first on "Maximum execution time exceeded"
| From: | Ferenc Kovacs | Date: | Mon, 22 Mar 2010 15:55:57 +0000 |
| Subject: | Re: [PATCH] Raise warning first on "Maximum execution time exceeded" | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-47453@lists.php.net to get a copy of this message | ||
On Mon, Mar 22, 2010 at 4:41 PM, Herman Radtke <hermanradtke@gmail.com>wrote:
> > What do you mean by "no option"? Otherwise yes, that's what it does.
> Using sleep there is not a good practice. Since the custom error
> handler is triggered, there is no need for the sleep call anyways.
>
> > I'm not sure I understand. Are you implying that it is somehow
> > possible to circumvent the second (fatal) error with this change? How?
>
> Consider for a second what you are asking the language to do. The
> script has run out of memory and instead of halting you want it to
> switch into an error handler to log the error. What happens when that
> error handler creates new variables or an object instance? Where does
> that memory come from?
>
> The out of memory is a good example, but not the only one.
If you reached the memory limit, but the system has available memory, then
it should be handled with a soft limit/hard limit.
> A better solution: generate a warning for scripts that use some target
> % of memory. I hate to add more ini settings, but for simplicity
> there could be a "memory_limit_warn" setting which you can set to
> something like "95%". When a script reaches that memory threshold it
> can trigger a warning so you can log it.
>
you can write that in userland with memory_get_usage.
but its just one case from the many.
Tyrael
>
> --
> Herman Radtke
> hermanradtke@gmail.com | http://hermanradtke.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>