Subject: Re: Anyone using current NetBSD with current mozilla?
To: None <current-users@netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: current-users
Date: 01/30/2004 03:18:52
--i7F3eY7HS/tUJxUd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Wolfgang S. Rupprecht wrote:
> I did notice something curious when using lsof to see how many fd's
> everyone used.  Some programs (like thttpd) had quite a few mmap-ed
> files open, but very few fd's tied up.  I never realized one could
> mmap a file and then close the associated fd.

That's required by POSIX.

> Is that really legit?
> Does he file then no longer count against the process's fd limits in
> the kernel?

AFAIK, the mmap'ed file becomes something like an additional swap. The
kernel only cares about the vnode. Otherwise, loading of shared objects
would have to work quite different or require you to increase your
ulimits especially if you use something based on KDE or GNOME.

Out of curiosity, if written a little test program which simply mmap()s
the first 4K of every file (e.g., find /usr | mmaptest). top shows
hardly any activity and even RAM seems to be untouched but the harddisks
make *very* scary noises. 61000 files so far. Oh, I see the kernel eats
around 100 megs now.

--=20
Christian

--i7F3eY7HS/tUJxUd
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD8DBQFAGb790KQix3oyIMcRAsoUAKC89/E9sD91edC27FGdJm0kT8NrZwCfWF7H
pYtRHLNxyfvxc2DrCXx/nTk=
=K411
-----END PGP SIGNATURE-----

--i7F3eY7HS/tUJxUd--