sort(1) memory usage

Dag-Erling Smørgrav des at des.no
Sun Feb 3 04:58:17 PST 2008


I've been trying to figure out why some periodic scripts consume so much
memory.  I've narrowed it down to sort(1).

At first, I thought the scripts were using it inefficiently, feeding it
more data than was really needed.  Then I discovered this:

des at ds4 ~% (sleep 10 | sort) & (sleep 5 ; top -o res | grep sort)
[1] 66024
66024 des          1  -8    5 54796K 52680K piperd 1   0:00  0.88% sort

That's right - sort(1) consumes 50+ MB of memory doing *nothing*.

(roughly half that on a 32-bit box)

Something is rotten in the state of GNU...

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-hackers mailing list