Subject: Re: find uses 400MB memory
To: Kazushi Marukawa (Jam) <jam@pobox.com>
From: Simon Burge <simonb@wasabisystems.com>
List: current-users
Date: 09/14/2001 17:25:34
Kazushi Marukawa wrote:

> That's true.  I did quick check by "find . -type f -print"
> on the same disk and it didn't use memory so much.  Sorry
> for doubting fts.  I should check -print first.  Thank you
> for the correction.

dmalloc (look in pkgsrc/devel/dmalloc) shows 26 lines like:

	1000452103: 113:  not freed: '0x8096208|s3' (160 bytes) from 'ra=0x480cf1c9'

when "find . -type f -exec ls \;" is run on a directory with 26 files :(
I haven't looked any further than this yet.

> BTW, what I did is "-exec crc-calc-program '{}' \;'.

For now, it may be simpler to use xargs(1).  Maybe

	find . -type f -print | xargs crc-calc-program

or (if crc-calc-program can only handle one argument at a time)

	find . -type f -print | xargs -n 1 crc-calc-program

If crc-calc-program can indeed process more than one file at a time, the
first xargs form will result in a lot less fork/exec's and will be more
efficient.

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/