bug-textutils
[Top][All Lists]
Advanced

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

sort's Large Memory Allocation


From: Mike Krebs
Subject: sort's Large Memory Allocation
Date: Wed, 6 Jun 2001 14:49:43 -0700 (PDT)

I have a problem with the recent version of sort not having enough memory
when I use "ulimit -v 100000" in a shell script.  I looked at sort's
source and I see that it was changed to allocate half of the available
physical memory, rather than to allocate 512k (what it did it 2.0).

So on my machine there is 1GB of physical memory -- with maybe 400MB free.  
Even with the patch installed (textutils-2.0.11-mem.patch), it will try to
allocate 128MB.  But since virtual memory has been limited to 100MB (with
"ulimit -v 100000"), sort can never get enough memory.

I did notice that the "-S" option was added to sort, but this shell script
(and therefore sort) is used across multiple platforms and multiple
distributions, so using that is not a very viable solution.

Can this be changed?  It seems like this behavior could cause a race
condition if multiple sorts were run at the same time (or other such
problems).  Or maybe there can be an "optimize for large files" switch
that would enable this behavior?

Thanks for any help you can give...

-- 
Michael Krebs




reply via email to

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