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 <rurban@x-ray.at>
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@cygwin.com
Subject: Re: Perl bug?
References: <20070122181727.GC27843@calimero.vinschen.de> <1552.67.40.28.188.1169493973.squirrel@67.40.28.188> <20070122202137.GC20665@calimero.vinschen.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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/

