Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76898 invoked from network); 6 Jun 2011 20:31:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 20:31:06 -0000 Authentication-Results: pb1.pair.com header.from=mike.vanriel@naenius.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.vanriel@naenius.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain naenius.com designates 83.96.159.14 as permitted sender) X-PHP-List-Original-Sender: mike.vanriel@naenius.com X-Host-Fingerprint: 83.96.159.14 linux35.webawere.nl Linux 2.6 Received: from [83.96.159.14] ([83.96.159.14:57159] helo=linux35.webawere.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/5F-23189-9093DED4 for ; Mon, 06 Jun 2011 16:31:05 -0400 Received: from localhost ([127.0.0.1] helo=webmail.naenius.com) by linux35.webawere.nl with esmtpa (Exim 4.76) (envelope-from ) id 1QTgRo-00023J-8T; Mon, 06 Jun 2011 22:30:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 06 Jun 2011 22:30:51 +0200 To: Julien Pauli Cc: =?UTF-8?Q?David_Z=C3=BClke?= , In-Reply-To: References: <73A0E06E-55E0-4C48-B8F8-BCAFA3216892@bitextender.com> Message-ID: <33db85fd3ebaa4f330120da5fa6445e1@naenius.com> X-Sender: mike.vanriel@naenius.com User-Agent: Roundcube Webmail/0.5.2 X-Antivirus-Scanner: Seems clean. You should still use an Antivirus Scanner Subject: Re: [PHP-DEV] Trying to find out where the memory went From: mike.vanriel@naenius.com (Mike van Riel) David and Pauli, When I change the test script to: var_dump(memory_get_peak_usage()); gc_collect_cycles(); token_get_all(file_get_contents()); gc_collect_cycles(); var_dump(memory_get_peak_usage()); And execute the following bash line preceding: export USE_ZEND_ALLOC=0 I get the following output: int(8240) int(8240) When I remove the gc_collect_cycles I get the same result. Even assigning the results to a variable do not increase the peak memory. FYI: When I change the argument of memory_get_peak_usage to 'true', I get the following results: int(262144) int(262144) This amount is astoundingly less than the previous conclusions and less than my own calculations would show. Of course this leads me to the following questions: 1. Does it hurt to disable the Zend MM? 2. Can it be done from inside a PHP Script? 3. Why is the memory consumption so much lower, even lower than my calculations? I assume it is a good thing to at least try to create an easy way to reproduce the issue (cannot include my test file) and create a bug report about this :) Thank you for your assistance thus far. Mike On Sun, 5 Jun 2011 15:36:43 +0200, Julien Pauli wrote: > Seems like leak. > > Try disabling ZendMM to see if something noticeable happens (memory > peak should be lower). > USE_ZEND_ALLOC=0 > > Cheers, > Julien > > On Sun, Jun 5, 2011 at 2:01 PM, David Zülke > wrote: >> Smells like a memory leak if gc_collect_cycles() doesn't fix it. >> >> David