Re: Argument list too long: out of environment space

From: Stuart Inglis (stuart@intelligenesis.net)
Date: Wed Mar 01 2000 - 17:11:57 EST


Mark Hahn wrote:
>
> > I have 9600 files in a directory and have troubles processing them. I
>
> it is not.
>
> > thought it was a bash problem but Chet Ramey kindly informed me that
> > it's a Linux kernel limitation.
>
> it is not.
>
> > bash: /bin/grep: Argument list too long
>
> the message is from bash. however, it's definitely user error,
> since long arg lists are inherently portable. "man xargs" for
> the portable and widely used solution.

xargs isn't a desirable option due to the large startup time of our
process.

In include/linux/binfmts.h we can see

/*
 * MAX_ARG_PAGES defines the number of pages allocated for arguments
 * and envelope for the new program. 32 should suffice, this gives
 * a maximum env+arg of 128kB w/4KB pages!
 */
#define MAX_ARG_PAGES 32

This seems to be the cause of our problem. When the total size of the
command line is over 128kB we start encountering this problem.

Can this value be safely increased? Does it need to be constant at all?

cheers
Stu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:11 EST