Date: Sun, 3 Feb 2008 14:13:22 +0100 From: Ed Schouten <ed@fxq.nl> To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no> Cc: hackers@freebsd.org Subject: Re: sort(1) memory usage Message-ID: <20080203131322.GK1179@hoeg.nl> In-Reply-To: <8663x6mc2o.fsf@ds4.des.no>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] * Dag-Erling Smørgrav <des@des.no> wrote: > 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@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... On my i386 box it spends 27M, but when I replace `sort' with `sed', without any arguments, it's only 1.4 MB. I tried this on RELENG_6. I can also reproduce this on Linux. -- Ed Schouten <ed@fxq.nl> WWW: http://g-rave.nl/ [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkelvfIACgkQ52SDGA2eCwVMMgCfSr+69jompdlAkN3rkIc3UZIA iqEAn3YNc1ShXVZ6JkvgKXSddX7aOHZs =8rpC -----END PGP SIGNATURE-----help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080203131322.GK1179>
