bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Gawk memory leak on match(s,r)?


From: Alain Ketterlin
Subject: Gawk memory leak on match(s,r)?
Date: Wed, 11 Jul 2007 16:10:32 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.1.4) / FreeBSD-6.2


Hi,

I just applied the following small program to a 1G+ file, and the
memory used (as shown by top's VIRT or RES columns) kept growing,
and swapping started to slow down the whole system.

{
   match($0,/ */);
}

My real prog is of course bigger, but this alone shows the problem. I
also noticed that adding a third parameter solves the problem, so:

{
    match($0,/ */,t);
}

has normal behavior (i.e., constant memory usage), even though t is never
used. It looks like there's a memory leak somewhere, that appears only
on large files. I'm sure you'll find that easily.

This is gawk 3.15, on Ubuntu 7.04.

Thanks for this great awk.

-- Alain.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]