Re: [PATCH] Patch to Memory Subsystem ... (Needed?)

Riley Williams (rhw@bigfoot.com)
Fri, 6 Nov 1998 21:02:55 +0000 (GMT)


Hi Meelis.

>> Just a thought, but how much memory does root need to do suchlike
>> cleanups? Let's see - load the login shell (probably already in
>> memory anyway, so 0k), run ps (may already be in memory) to find
>> out which processes are currently hogging memory, then kill
>> (usually a shell internal, so 0k) to get rid of a few of
>> them...that should do...

> You are not counting the individual data segments of every bash
> etc...

True, but how much space does bash need for its data segment?

Omitting the sarcasm, can we see if we can arrive at a figure for the
amount of RAM needed for a script similar to the following to run,
which is basically what Brian's looking at.

Q> #!/bin/ash
Q> /usr/bin/killall -9 $1

Assuming that it's run from CRON and cron is already in memory at the
time (which it usually will be as it auto-runs once a minute), my
analysis would go as follows:

1. First, let's assume the script takes up a page of memory, either
4k or 8k depending on the system.

2. According to my info, /bin/ash is just over 61k in size, so would
occupy 64k for itself, and let's say another 16k maximum for its
data and stack combined. That's 80k total.

3. Also according to my info, /usr/bin/killall is 8540 bytes in size,
so would occupy either 12k or 16k depending on page size, and lets
allow a further 16k for data and stack combined. At worst, that's
32k total.

Adding those together, I get 120k required at worst.

Comments, anybody ???

Best wishes from Riley.

-
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/