Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17698 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31968 invoked by uid 1010); 9 Aug 2005 15:07:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31953 invoked from network); 9 Aug 2005 15:07:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Aug 2005 15:07:23 -0000 X-Host-Fingerprint: 195.225.34.5 unknown Received: from ([195.225.34.5:24352] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id BD/4F-04646-AA6C8F24 for ; Tue, 09 Aug 2005 11:07:22 -0400 Message-ID: To: internals@lists.php.net Date: Tue, 9 Aug 2005 17:07:17 +0200 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Posted-By: 195.225.34.5 Subject: drastic memory consumption with a sequence of exceptions From: r.korving@xit.nl ("Ron Korving") I've noticed that in a script of mine, memory consumption can explode quite drastically when Exceptions are thrown, opposed to very normal memory consumption when exceptions are not thrown. This is the idea: process(); } catch (Exception $e) { $errors[] = $e->getMessage(); } } ?> When exceptions are not thrown, memory consumption is normal. The method's local vars are freed and not much more memory is used in the 50th pass compared to the 1st. But when exceptions are thrown, memory consumption increases quite a bit every pass. In the end (within the 60 passes of my loop) over 8 MB's are used. Of course, I can unset a lot of data before throwing exceptions to free up memory and the problem will be solved. But it would be nicer if the cleanup would happen as an exception is thrown. Can this be considered a bug or is this behavior known and accepted? Ron