[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: memory allocation bug in bash 4.2.39(1)-release
From: |
Chet Ramey |
Subject: |
Re: memory allocation bug in bash 4.2.39(1)-release |
Date: |
Mon, 12 Aug 2013 12:07:44 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 |
On 8/10/13 12:47 AM, Bob Proulx wrote:
> John Vincent wrote:
>> I find that if I enter the command:
>> echo {1..20000000}
>> it runs, but afterwards whenever I enter another command I get the error:
>> -bash: fork: Cannot allocate memory
>
> You need to allocate more virtual memory space to your machine. You
> are asking it to do more than it can do with the memory it has
> available.
>
>> I guess that the memory allocated to all those numbers on the echo
>> command line is not freed properly.
>
> This has been discussed previously. Please see this message thread
> for the previous discussion.
>
> http://lists.gnu.org/archive/html/bug-bash/2011-11/msg00181.html
Other references:
http://lists.gnu.org/archive/html/bug-bash/2008-05/msg00047.html
http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00006.html
In short: malloc requests memory from the kernel but only returns it to
the kernel under certain special circumstances.
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/