Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4349 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51516 invoked by uid 1010); 2 Sep 2003 10:13:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51459 invoked from network); 2 Sep 2003 10:13:42 -0000 Received: from unknown (HELO bgbest.net) (212.91.188.18) by pb1.pair.com with SMTP; 2 Sep 2003 10:13:42 -0000 Received: (qmail 31055 invoked from network); 2 Sep 2003 10:13:38 -0000 Received: from unknown (HELO damagegqsaogpp) (212.91.188.150) by dns.bgbest.net with SMTP; 2 Sep 2003 10:13:38 -0000 To: "PHP-DEV" Date: Tue, 2 Sep 2003 13:13:45 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: A note about the Zend low level memory manager in zend_mm.c From: vma1@abv.bg ("Vesselin Atanasov") Hello. The current low-level memory management code in zend_mm.c places the free blocks as first on the bucket. This increases the fragmentation of newly allocated free blocks. I think it is a good idea to place the freed or newly allocated blocks as last on the bucket. Thus when a new block is allocated the allocation scheme will give preference to old and already fragmented memory segments. The new segments will be used only when a request for a big block is made. This will significantly decrease the memory fragmentation. The current scheme uses the newly allocated segments as soon as possible because they are placed first on the list. This combined with the bad (IMHO) scheme of the high-level memory caching creates enormous memory fragmentation. A script that needs about 2MB of memory when run several times in a row may cause PHP to allocate about 10 MB of memory. vesselin