[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory leak
From: |
Aharon Robbins |
Subject: |
Re: Memory leak |
Date: |
Tue, 14 Apr 2009 11:19:38 +0300 |
Hi. What version of gawk are you using?
gawk --version
to find out. I don't see a problem using the current CVS version and valgrind
and a smaller loop count so that it will terminate in enough time to see
something.
Thanks,
Arnold
> To: address@hidden
> Subject: Memory leak
> From: Aleksey Cheusov <address@hidden>
> Date: Mon, 13 Apr 2009 20:42:08 +0300
>
> 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 <=