[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Findutils-patches] [PATCH 2/4] Reduce memory consumption of oldfind
From: |
Jim Meyering |
Subject: |
Re: [Findutils-patches] [PATCH 2/4] Reduce memory consumption of oldfind on large directories. |
Date: |
Sun, 21 Aug 2011 09:18:04 +0200 |
James Youngman wrote:
> * find/find.c (process_dir): Reduce memory consumption for large
> directories. Don't save the whoel directory content with
whoel -> whole
> xsavedir, instead just loop over the results of readdir. This
> means that oldfind will consume one file descriptor per directory
> level.
> * find/testsuite/sv-34079.sh: verify that the memory consumption
> of oldfind is reasonable on large directories.
...
> diff --git a/find/testsuite/sv-34079.sh b/find/testsuite/sv-34079.sh
> index ea6aea6..5773a3f 100755
> --- a/find/testsuite/sv-34079.sh
> +++ b/find/testsuite/sv-34079.sh
> @@ -52,13 +52,14 @@ if [[ -n "${RUN_VERY_EXPENSIVE_TESTS}" ]]; then
> # it stores all the directory entries. Hence the excessive
> # memory consumption bug applies to oldfind even though it is
> # not using fts.
> - exe="${ftsfind}"
> - echo "Checking memory consumption of ${exe}..." >&2
> - if ( ulimit -v 50000 && ${exe} "${outdir}" >/dev/null; ); then
> - echo "Memory consumption of ${exe} is reasonable" >&2
> - else
> - bad="${bad}${bad:+\n}Memory consumption of ${exe} is too high"
> - fi
> + for exe in "${ftsfind}" "${oldfind}"; do
> + echo "Checking memory consumption of ${exe}..." >&2
> + if ( ulimit -v 50000 && ${exe} "${outdir}" >/dev/null; );
> then
> + echo "Memory consumption of ${exe} is reasonable" >&2
> + else
> + bad="${bad}${bad:+\n}Memory consumption of ${exe} is
> too high"
> + fi
> + done
> else
> bad="failed to set up the test in ${outdir}"
> fi
It's nice to describe both success and failure like that.
In many coreutils tests, we're too succinct, often with just "fail=1".
I will try to follow your example (at least for failures).