[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4] Reduce memory consumption of oldfind on large directorie
From: |
Jim Meyering |
Subject: |
Re: [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).
- [PATCH] rm, du, chmod, chown, chgrp: use much less memory for large directories, Jim Meyering, 2011/08/19
- Re: [PATCH] rm, du, chmod, chown, chgrp: use much less memory for large directories, Erik Auerswald, 2011/08/19
- [PATCH 2/4] Reduce memory consumption of oldfind on large directories., James Youngman, 2011/08/20
- Re: [PATCH 2/4] Reduce memory consumption of oldfind on large directories.,
Jim Meyering <=
- [PATCH 3/4] Remove no-longer-used files savedir.[ch]., James Youngman, 2011/08/20
- [PATCH 1/4] Reduce memory consumption of fts., James Youngman, 2011/08/20
- [PATCH 4/4] Describe recent memory savings on very large directories., James Youngman, 2011/08/20
- RE: [PATCH] rm, du, chmod, chown, chgrp: use much less memory for large directories, Voelker, Bernhard, 2011/08/23
- Re: [PATCH] rm, du, chmod, chown, chgrp: use much less memory for large directories, Jim Meyering, 2011/08/23
- RE: [PATCH] rm, du, chmod, chown, chgrp: use much less memory for large directories, Voelker, Bernhard, 2011/08/23
- Re: [PATCH] rm, du, chmod, chown, chgrp: use much less memory for large directories, Jim Meyering, 2011/08/24