> And I get a 'well on some instances the memory may be requested but never
> I think that with that something is seriously wrong. Why on earth woudl
> someone design a program to request memory it will never use?
Sparse arrays (hash tables, big nasty math, etc.), as well as
pre-allocating a large pool for a sub-allocator. Linux's COW and zero-page
facilities make these very valuable techniques.
Conceptually (and technically), libraries and executables are also loaded
in this fashion: if some routine is never called, or a string never used,
it may never be loaded in from disk.
> And then there's the 'evil process' scenario, where some user maliciously
> eat all memory on the system. There should be a failsafe protecting the
> system from a malicious userspace program. Is't there already.
Yes, of course. The problem is that a normal system can still run out of
memory -- this isn't the Mac (with fixed limits per app), and we don't all
carefully tune our apps for optimal memory usage. And, we sometimes end up
running apps that we didn't mean to run (or at least we didn't expect them
to use up that much memory at this particular time).
Basically, do you want to prove (in the math sense) that your system will
never use more memory then is available?
(Also: "never attribute to evil what can be attributed to lazyness", or
something like that. Evil programs are one thing, lazy operators are
> Other than that, if you don't have the blessed memory, you obviously need
And the entire OOM issue is what happens in the juncture between finding
this out, and installing the memory. "Graceful degradation" is a very
important concept, IMO.
-- Kenneth Albanowski (firstname.lastname@example.org, CIS: 70705,126)
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com Please read the FAQ at http://www.tux.org/lkml/