X-Spam-Check-By: sourceware.org Message-ID: <45B540FF.6060101@x-ray.at> Date: Mon, 22 Jan 2007 23:55:59 +0100 From: Reini Urban User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1) Gecko/20061101 SeaMonkey/1.1b MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Perl bug? References: <20070122181727 DOT GC27843 AT calimero DOT vinschen DOT de> <1552 DOT 67 DOT 40 DOT 28 DOT 188 DOT 1169493973 DOT squirrel AT 67 DOT 40 DOT 28 DOT 188> <20070122202137 DOT GC20665 AT calimero DOT vinschen DOT de> In-Reply-To: <20070122202137.GC20665@calimero.vinschen.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Corinna Vinschen schrieb: > On Jan 22 11:26, Yitzchak Scott-Thoennes wrote: >>> Hi, >>> >>> consider the following statement: >>> >>> $a = "a" x (100 * 1024 * 1024) >>> >>> When you create a script which does this over and over again, you'll >>> observe a strange memory problem. >> Can you show your script? > > #!/usr/bin/perl > $a = "a" x (100 * 1024 * 1024); > sleep 5; > $b = "b" x (100 * 1024 * 1024); > sleep 5; > $c = "c" x (100 * 1024 * 1024); > sleep 5; .... perl is made this way. All vars are still in scope and all vars together require a lot of memory. How about: #!/usr/bin/perl { my $a = "a" x (100 * 1024 * 1024); sleep 5; } { my $b = "b" x (100 * 1024 * 1024); sleep 5; } { my $c = "c" x (100 * 1024 * 1024); sleep 5; } ... Than you get better mmap figures. -- Reini Urban http://phpwiki.org/ http://murbreak.at/ http://helsinki.at/ http://spacemovie.mur.at/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/