Subject: Re: Two unrelated problems on my AlphaStation 200
To: Michael G. Schabert <mikeride@prez.buf.servtech.com>
From: Chris G. Demetriou <cgd@netbsd1.cygnus.com>
List: port-alpha
Date: 08/04/1998 09:39:01
"Michael G. Schabert" <mikeride@prez.buf.servtech.com> writes:
> While I agree that 16 MB isn't enough to run an active un*x on, it should
> be able to at least boot, and the requirements aren't very much beyond
> that. On port-mac68k, I've seen people with 8 MB systems boot fine
> (although that's a 32-bit system).

Boot, or boot quickly, sanely, without paging a fair bit?

First of all, you don't even have 16MB in a 16MB system.  The firmware
eats, and owns, 2MB.  So you have 14.

A generic kernel (1.3F; Ross's end-of-june snapshot) is:

1 [alpha] cgd % size /netbsd
text    data    bss     dec     hex     filename
2230800 176776  246264  2653840 287e90  /netbsd

You now have 11.5MB.

Your buffer cache is goign to eat another meg or so.

Let's assume that by the time you get up to multi-user mode and a
shell prompt you have 20 processes running.  20 * (2 pages of uarea +
1 page L1PT + 1 page L2 pt + 1 page L3 pt) = 100 pages == 800k.  In
reality (IIRC) dynamically linked processes will need more than one
L3.  (I forget where we put the stack these days; that could add to
it, too.)

After you account for page tables and all that, you've got less than
10MB left.  that gives you (on average) less than 500KB of memory for
each process process, if you don't consider: processes that don't
'live through' startup (i.e. things which do actions and then exit,
and don't live on in multi-user mode), any other run-time use of
memory by the system, or the fact that the system likes to keep some
pages free.

In other words, paging on a 16MB machine is to be expected, even if
you're just booting to multi-user mode.

It should _work_, i.e. succeed and get to a prompt (if you have a swap
device configured), but it'll page.


The 32-bit vs. 64-bit system comparison is a serious one.  Also
there's the fact that m68k processors are CISC, and the Alpha is most
definitely RISC.  That leads to, overall, inflation.  More than you
might think.  (Compare the kernel sizes, for instance.)



> On my AlphaStation, I just quit all of
> my memory-hogging applications and Top reports active memory usage at under
> 6 MB:
>
> Memory: 5784K Act 2736K Inact 248K Wired 54M Free 8K Swap 227M Swap free
> 
> Given this, I would hope that we could at least boot with 16 MB RAM. Even
> with 2 fairly large MUDs, Apache, and compilations going, I've never gone
> beyond about 40 MB active RAM usage, and usually hover between 25 and 35 MB.

FWIW, i'm not sure that I really believe those numbers.  They've never
seemed to actually make sense or correspond to what was going on with
my machines at the time.  (That doesn't mean that they're invalid,
only that i've never been able to grok their validity. 8-)

My AlphaStation 200 with 32MB of RAM (running an HTTP server that's idle; i'm unpopular! 8-) and my network login (rsh) and other than that the 'minimum' amount of stuff, says:

$ vmstat -s
     8192 bytes per page
     3438 pages managed
     1289 pages free
     1040 pages active
      253 pages inactive
        0 pages paging
       53 pages wired
...

It only has 10MB free, and it's not doing _anything_ other than coping
with my login.  (FWIW, there are 27 processes running, 6 of which are
httpds.  The system hasn't paged at all.)



cgd