ubuntu jaunty seized up

Smoot Carl-Mitchell smoot at tic.com
Mon May 4 20:13:16 UTC 2009


On Mon, 2009-05-04 at 12:42 -0700, Smoot Carl-Mitchell wrote:
> On Mon, 2009-05-04 at 12:24 -0700, prad wrote:
> > 
> A memory leak is where a program continues to allocate memory without
> returning unused memory back to the system.  The symptoms will be a
> continuous increase in the size of the program.  A simple program with a
> memory leak would be something like:
> 
> #! /usr/bin/perl -w
> 
> # Array grows without bound (slowly)
> 
> my @x = ();
> 
> my $i = 0;
> 
> while (1) {
> 	sleep 1;
> 	$x[$i] = $i;
> }
> 

Oops.  Forgot to increment $i.  Should be:

$x[$i] = $i++;

-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list