Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10314 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65967 invoked by uid 1010); 8 Jun 2004 11:58:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65931 invoked from network); 8 Jun 2004 11:58:51 -0000 Received: from unknown (HELO devel.bitflux.ch) (212.71.98.108) by pb1.pair.com with SMTP; 8 Jun 2004 11:58:51 -0000 Received: from localhost (localhost [127.0.0.1]) by devel.bitflux.ch (Postfix) with ESMTP id BFB6E815E6; Tue, 8 Jun 2004 13:58:49 +0200 (CEST) Received: from devel.bitflux.ch ([127.0.0.1]) by localhost (devel.bitflux.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23313-01-8; Tue, 8 Jun 2004 13:58:40 +0200 (CEST) Received: from [192.168.0.100] (bx-109.bitflux.ch [212.71.98.109]) by devel.bitflux.ch (Postfix) with ESMTP id A3740815D4; Tue, 8 Jun 2004 13:58:39 +0200 (CEST) Message-ID: <40C5A9EF.5010503@bitflux.ch> Date: Tue, 08 Jun 2004 13:58:39 +0200 User-Agent: Mozilla Thunderbird 0.6 (Macintosh/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nuno Lopes Cc: internals@lists.php.net References: <40C5959A.2010600@bitflux.ch> <009f01c44d45$51d9d8d0$0100a8c0@pc07653> In-Reply-To: <009f01c44d45$51d9d8d0$0100a8c0@pc07653> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at bitflux.ch Subject: Re: [PHP-DEV] Mem Leak in Tidy, ZE2 Bug? From: chregu@bitflux.ch (Christian Stocker) On 8.6.2004 12:42 Uhr, Nuno Lopes wrote: >>Hi >> >>I'm not sure, who to blame about this one, but I run against a memory >>leak if I run the following code: >>*** >>$html = "foo"; >>$options = array("char-encoding" => "utf8"); >>$tidy = new tidy(); >>$tidy->parseString($html,$options,$options['char-encoding']); >>print $tidy; >>*** >> >>If the 3rd param is not part of the array of the second param, there's >>no memleak.. >>Any ideas, what's going wrong here? > > > I have no problems here. > You shouldn't use the char-encoding as option (the second paramether)!! You > should just set the last parameter, as it will set the input and ouput > charset!! See Derick's answer, that's not the point ;) Anyway, I filed a bug report for tidy (there was also a second memleak) at http://pecl.php.net/bugs/bug.php?id=1580 chregu -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECB