http://bugzilla.novell.com/show_bug.cgi?id=562232
http://bugzilla.novell.com/show_bug.cgi?id=562232#c15
--- Comment #15 from Jeff Mahoney 2009-12-17 15:12:22 UTC ---
Michal did not suggest adding memory, he suggested changing your limit for
virtual memory. They're not the same thing and virtual memory is not just
another term for "swap" despite how MacOS and Windows have abused the term.
Virtual memory is the address space associated with a program. Each program has
it's own 32/64-bit address space, of which most of it is potentially usable.
Much of it never is. It can be used by the program instructions, dynamic memory
(like malloc), shared libraries, and mmap. Shared libraries can take up a
considerable amount of your address space - but there is usually only a single
copy in memory that is shared by all programs that need it. So for an easy
example, every program running on your system right now probably uses libc. On
my system, that is about 1.4M. I have about 200 processes running on my system,
but that library will only ever take a maximum of 1.4 MB of memory.
UNIX systems have a facility called mmap, which gives programmers the ability
map files into the address space of the program and access them as if they were
loaded from disk into a chunk of memory. The difference is that only the
portions that are actually accessed ever get read in from disk. Shared
libraries use this and only ever load the parts of the library that are
actually needed. This happens automatically when the memory is accessed. So for
my libc example where I said it loads a maximum of 1.4 MB, it's actually less
than that. There are portions of the library that are needed for compatibility
but are hardly ever actually used. That code never gets loaded from disk.
For kernel modules, depmod really only needs the module headers and the symbol
table. The debuginfo isn't used and is never loaded. That's why Michal is
saying that while the modules on disk take up over 800 MB, depmod only ever
allocates a few MB. That's all it's actually using and that's all that has ever
been read in from disk.
BUT for sake of argument, lets say it did read everything in, since this seems
to be the core of the misunderstanding here. If the system ran low on memory,
the memory used by the modules wouldn't get pushed out to swap. Swap is used
when the kernel doesn't have any other way to restore the contents of the
memory when it's needed again. Since the kernel modules are already on disk, in
your file system, it can just reuse the memory without writing anything out and
re-read them from the file system when it's needed again. Swap would never be
touched.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.