[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Memory leak
From: |
Aleksey Cheusov |
Subject: |
Memory leak |
Date: |
Mon, 13 Apr 2009 20:42:08 +0300 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) |
The following test programs shows that there is a memory leak somewhere
in GAWK.
#!/usr/bin/gawk -f
BEGIN {
val_hash1 [1] = 1
for (j=1; j<=100000000; j++) {
test2( val_hash1 )
}
}
function test2 (ValHash1, i)
{
for (i in ValHash1) {
return # *** #
}
}
This program fails like this.
0 cheusov>gawk -f ~/tmp/2.awk
gawk: /home/cheusov/tmp/2.awk:16: fatal: push_forloop: loop_stack: can't
allocate 25165824 bytes of memory (Cannot allocate memory)
2 cheusov>
After changing 'return' statement marked as '# *** #' to 'break',
everything works fine.
The problem is reproducinble under NetBSD and Linux.
--
Best regards, Aleksey Cheusov.
- Re: Memory leak, Aharon Robbins, 2009/04/14
- Memory leak,
Aleksey Cheusov <=