Re: FDs & linux again.

From: David J Woolley <>
Date: Tue, 12 Jan 1999 16:17:49 +0000

> nope, I've read the FAQ carefully and it's not that. :(

If you are unsing Linux, I imagine that the kernel will call kmalloc
for as structure whose size is proportional to the highest FD
specified in the request. It is possible that the kmalloc is failing
because kernel memory is too fragmented to allow a contiguous
allocation of the required size; if you really get silly, you could
exceed the 128k absolute limit for kmalloc.

There are alternatives to kmalloc for allocating large amounts of
memory, but I imagine the kernel writers didn't expect huge select

To confirm that kmalloc is used, you will need to look at the source
code. To find out what size of free memory are available, there is a
debug function mapped to shift or control scroll-lock (I think) -
these may well not be nice to the system. A partial solution to
fragmentations may be to adjust /proc/sys/vm/freepages to set a
higher target number of free pages.

David Woolley - Office: David Woolley <>
BTS             Home: <>
Wallington      TQ 2887 6421
England         51  21' 44" N,  00  09' 01" W (WGS 84)
Received on Tue Jan 12 1999 - 09:56:47 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:43:59 MST