Re: Re: drastic memory consumption with a sequenceofexceptions
| From: | Wez Furlong | Date: | Wed, 10 Aug 2005 14:02:33 +0000 |
| Subject: | Re: Re: drastic memory consumption with a sequenceofexceptions | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17786@lists.php.net to get a copy of this message | ||
foreach() 'copies' $data, and it's the copy that isn't going away.
--Wez.
On 8/10/05, Ron Korving <r.korving@xit.nl> wrote:
> "Derick Rethans" <derick@php.net> schreef in bericht
> news:Pine.LNX.4.62.0508101456350.3884@localhost...
> > On Wed, 10 Aug 2005, Ron Korving wrote:
> >
> > > My situation is parsing a number of XML-reports. If parsing goes wrong
> in
> > > any way (XML parsing fails, XML validation fails, database insertion
> fails),
> > > I want to throw an exception. There's a script that batch-processes
> these
> > > files. I want to collect exceptions and give that feedback to the user.
> I
> > > wouldn't consider this bad practice myself (but of course, I'm not very
> > > objective in this situation).
> >
> > You can still clean up your memory before throwing the exception...
>
> Actually, no. Even this shows the problem:
>
> foreach ($data as $line)
> {
> unset($data);
> throw new Exception("error");
> }
>
> > > Even if I'm wrong about that, I'm not the only PHP-user and it's my
> humble
> > > opinion that the engine should be solid enough to deal with this.
> >
> > It's not easy at all, it would basically mean a full rewrite of the
> > engine's refcounting/garbage collection system, and also redoing all
> > extensions to use this mechanism. I think that's a bit too much to ask
> > just so that you don't get a leak if you're doing something 'weird'.
>
> I never thought it would be easy. And I'm not saying it must be fixed. But I
> do think, more on the philosophical level as a programmer, that the engine
> "should" be able to deal with that situation.
>
> Ron
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>