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 c...@case.edu http://cnswww.cns.cwru.edu/~chet/