I have a problem with /usr/bin/ls on a Intel Unixware 2.1.2 server. When
issuing a 'ls' command on a directory containing lots of files I get this:
$ ls
UX:ls: ERROR: Out of memory: Insufficient or invalid memory
The directory contains 15332 files. The error only occurs when I have a
large number of files. /usr/ucb/ls can do the job, but i would prefer a
working /usr/bin/ls.
Suggestions (or known patches to the problem) are very welcome.
Please respond by email. I only stop by this NG on occation.
Thanks in advance.
Lars Brogaard (l...@datrix.icl.dk)
There is a kernel parameter to tune to fix this.
Log in as root
Go to /etc/conf/bin
Run : ./idtune -f ARG_MAX 20480
Run ./idbuild -B to rebuild the kernel
Run init 6 to reboot
The problem should be fixed. If u still have problem, you can up ARG_MAX.
Hope it helps
Hannes Visagie
Lars Brogaard <l...@datrix.icl.dk> wrote in article
<6ceriq$co9$1...@bambi.danosi.dk>...
: There is a kernel parameter to tune to fix this.
: Log in as root
: Go to /etc/conf/bin
: Run : ./idtune -f ARG_MAX 20480
: Run ./idbuild -B to rebuild the kernel
: Run init 6 to reboot
: The problem should be fixed. If u still have problem, you can up ARG_MAX.
: Hope it helps
: Hannes Visagie
Nope, it won't help. His problem is NOT that he can't expand
a * list, as in ls * on a very large directory. It's this case
where ARG_MAX is important.
His problem is that ls can't sort the large directory because
of too low a memory ulimit. He should either change the relevant
kernel tunables for the memory limits (both hard and soft, for
both data and total virtual memory), or simply up the ulimit -v
and ulimit -d settings from the (Bourne or Korn) shell. Only
root can do either, of course.
In many cases the solution is the ls -f option, which suppresses
the sorting and gives the directory contents in a sort-of
random way, similar to find (or DOS, for that matter!)
After over 15 years of UNIX, I learned about ls -f only last week!
: Lars Brogaard <l...@datrix.icl.dk> wrote in article
: <6ceriq$co9$1...@bambi.danosi.dk>...
: > Hello all,
: >
: > I have a problem with /usr/bin/ls on a Intel Unixware 2.1.2 server. When
: > issuing a 'ls' command on a directory containing lots of files I get
: this:
: >
: > $ ls
: > UX:ls: ERROR: Out of memory: Insufficient or invalid memory
: >
: > The directory contains 15332 files. The error only occurs when I have a
: > large number of files. /usr/ucb/ls can do the job, but i would prefer a
: > working /usr/bin/ls.
: >
: > Suggestions (or known patches to the problem) are very welcome.
: >
: > Please respond by email. I only stop by this NG on occation.
: >
: > Thanks in advance.
: > Lars Brogaard (l...@datrix.icl.dk)
: >
: >
: >
: >
--
*******************************************************************
Martin F. Sohnius msoh...@novell.co.uk
Novell IS & T, Bracknell, England +44-1344-724031
*******************************************************************
* if (status = UNDER_NUCLEAR_ATTACK) *
* launch_full_counterstrike(); *
*******************************************************************
(C) 1997 M.F.Sohnius -- free distribution on USENET
(Not a spokesperson -- just a cyclist!)
It's not a "sort-of" random way. Both 'find' and 'ls -f' just grab
directories in the order in which they exist in the directory.
IOW, open the directory and read the entries from top to bottom.
| After over 15 years of UNIX, I learned about ls -f only last week!
That's either a credit to the vast power of Unix, or to the openness of
your mind, or both!
[Have you established decent comfort with 'ls -F', BTW?]
--
Jean-Pierre Radley <j...@jpr.com> XC/XT Custodian Sysop, CompuServe SCOForum