Re: OOM band-aid

Kenneth Albanowski (kjahds@kjahds.com)
Thu, 8 Oct 1998 19:42:37 -0400 (EDT)


On Thu, 8 Oct 1998, Ely Wilson wrote:

> And I get a 'well on some instances the memory may be requested but never
> used'.
>
> 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
another.)

> Other than that, if you don't have the blessed memory, you obviously need
> more.

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 (kjahds@kjahds.com, CIS: 70705,126)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/