bug-bash
[Top][All Lists]
Advanced

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

Re: Parameter Substitution Causing Memory Leak


From: Todd B. Stein
Subject: Re: Parameter Substitution Causing Memory Leak
Date: Tue, 7 Jan 2014 12:18:18 -0800

These bugs result in gradual slowdown of indefinitely-running scripts which
rely on parameter substitution (rather than forking sed or awk) for speed
and efficiency. Forgive me if I used the wrong terminology, but whether
these bugs are considered honest-to-goodness "memory leaks" by valgrind
seems unimportant.

Are you saying these bugs have been fixed, and that they no longer exist in
bash 4.3?


On Tue, Jan 7, 2014 at 11:12 AM, Chet Ramey <chet.ramey@case.edu> wrote:

> On 1/7/14, 2:27 AM, toddbstein@gmail.com wrote:
>
> > Repeat-By:
> >       These can all be demonstrated by running a script consisting of an
> infinite loop which repeatedly executes any command utilizing any of the
> above examples. Like this:
> >
> >               #!/bin/bash
> >
> >               while :; do
> >                       echo ${variable/pattern}
> >               done
> >
> >       The resident memory size will continually grow. This occurs on
> both CentOS 6.5 (bash 4.1.2) and Fedora 20 (bash 4.2.45).
>
> Have you run any of these through valgrind? I ran a few, and it did not
> report any leaks, at least on bash-4.3-rc1. The increase in memory size is
> probably from malloc  getting memory from the kernel but not releasing it
> back to the kernel after bash calls free (giving memory back to the kernel
> is harder than you think).
>
> Chet
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, ITS, CWRU    chet@case.edu
> http://cnswww.cns.cwru.edu/~chet/
>


reply via email to

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