Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Dec 2002 05:53:19 -0800
From:      David Schultz <dschultz@uclink.Berkeley.EDU>
To:        Varshavchick Alexander <alex@metrocom.ru>
Cc:        Terry Lambert <tlambert2@mindspring.com>, freebsd-questions@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: maxusers and random system freezes
Message-ID:  <20021205135319.GA12456@HAL9000.homeunix.com>
In-Reply-To: <Pine.GSO.4.33.0212051552400.7912-100000@apache.metrocom.ru>
References:  <3DEF2573.D8C66C11@mindspring.com> <Pine.GSO.4.33.0212051552400.7912-100000@apache.metrocom.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Varshavchick Alexander <alex@metrocom.ru>:
> A question arises. The value 256 (1G KVA space) acts as a default for any
> system installation, not depending of real phisical memory size. So for
> any server with RAM less than 2G (which is a majority I presume) the KVA
> space occupies more than half of physical memory. It can even be more than
> TOTAL phisical memory for servers with RAM less than 1G. Isn't it bad for
> a system? It seems that it is not. Then why cannot the KVA space always be
> made as some big value? If it is important for servers with large RAM, why
> it is not or a smaller servers?

In FreeBSD, each process has a unique 4G virtual address space
associated with it.  Not every virtual page in every address space
has to be associated with real memory.  Most pages can be pushed
out to disk when there isn't enough free RAM, and unallocated
parts of the virtual address space aren't backed by anything.
(Referencing an unmapped page that the system doesn't know about
generally causes the program or OS to crash.  You've probably seen
these as ``segmentation faults'' and ``page fault in kernel mode''
panics.)

To simplify things, the kernel is mapped into a fixed location in
every address space.  The KVA parameter controls how big a chunk
the kernel gets; the remainder goes to user processes.  However,
only the part of the KVA reservation that the kernel actually uses
is wired to physical memory.  For example, if you have a 1 GB KVA
reservation and the kernel allocates only 20 MB of RAM, then only
20 MB of RAM is needed (plus some epsilon if you want to be
picky), but in theory, the kernel could allocate and manage up to
1 GB of data.  You don't lose extra physical memory for increasing
KVA, but a large KVA size does constrain the virtual address space
available to user processes.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021205135319.GA12456>