Subject: Re: Memory Management, NT vs. Unix From: Rex Ballard Date: Wed, 3 Jul 1996 23:50:45 -0400
How the Web Was Won
Subject: Re: Memory Management, NT vs. Unix From: Rex Ballard Date: Wed, 3 Jul 1996 23:50:45 -0400
In-Reply-To: <4rbgab$gbq@aphex.direct.ca>
Message-ID: 
References: <31D92162.2781E494@xylogics.com> <4rbgab$gbq@aphex.direct.ca>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


On 2 Jul 1996, Kazinator wrote:

> In article <31D92162.2781E494@xylogics.com>,
> Ben Boule   wrote:
> >Just a thought.
> >
> >I was really impressed when I saw how Unix controls resources(at
> >school), especially the way demand paging allows the os to run 
> >more apps by only keeping the running part of the app in memory.
> >Do any of the Microsoft OS'es do this? 

Actually, Windows NT does have the ability to swap and page memory.  This
is known as demand paged virtual memory, and NT does have it.  HOWEVER:

> >In my experience, (3.1,95,NT) they do not.  This seems supported
> >by the fact that a 16MEG NT machine cannot run Photoshop and
> >Netscape at the same time (i.e. for web development) without 
> >causing a 10-20 sec disk grind when hitting alt-tab.

HEERE's where life gets interesting.  Was the Photoshop gife being used by
Netscape Gold?   If so, we have certain memory that cannot be demand
paged.  Fore example:
	You can't swap out the image space because the operating system
uses the application's memory buffer to manage the interaction.  The VDI
tells the GDI what to display.  Unfortunately, once control leaves the
application, neither side can page out the memory because neither side
knows if the other is modifying it.  This is especially bad with bitmaps
which can be modified by either side at any time.

	You can't swap out the OLE buffer between the two applications for
the same reason.  Since both are likely to keep cache in memory, both are
effectively locked out.  Either side can modify the shared memory at any
time.  Therefore neither side can "page out".

>  This seems
> >ridiculous, especially when the user is probably only using 10%
> >of the code for Photoshop at any given time, and probably <5% of
> >Netscape's code.

actually, you could page out things like help files, but because MFC's
allocate their memory one object at a time, and read all of the
configuration information into memory, then jump from object to object as
the container is traversed, it becomes near to impossible to know what to
swap out.  Since most of the library routines are actually DLLs, all of
the memory has to be allocated using malloc or calloc, by the base
classes.  As a result, every instance you hit will bring 4k of "garbage"
with it.  Unix stores static information in it's xrdb resource database on
the server.  Since the server is simply another application, it has
complete control of it's own variables (and only those variables).  If the
application wants those values, it can ask the server for them.

> >If anybody nows what system NT uses, i.e. Swapping, Simple Paging,
> >Demand Paging, etc..  I would guess simple paging, as it seems to
> >swap whole apps in and out rather than just the part that is running.
> >But I would also guess that they wouldn't stoop to simple swapping.

It is actually Demand Paging, but the applications constantly demand
everything all the time.  That thrashing is actually the container objects
on the second application being swapped in on page at a time.  The pages
are also very large anywhere from 4-16K depending on your cluster size.

> This is probably covered in the book _Inside Windows NT_. I tried
> to read it but it's too painfully dull, and insulting to a UNIX programmer's
> intelligence.

Unix programmers can actually look at the Linux kernel source code and
figure out exactly how to tune the kernel.  About 3 people in the entire
world have seen the swap code for NT, and they are sworn never to divulge
their secrets.  You could dissassemble the object code, but then Microsoft
would have you sentencet to 5-25 years in prison for violation of
copyright licenses.  Or they could just refuse to sell your company
software support for as long as you are working there.

> The introduction by Dave Cutler is worthwhile, however.
> It exposes him as an impostor who broke into the computing field at a time
> when knowing how to spell the word ``computer'' could get you a decent job.

There were two camps.  One in Albaquerque/Seattle the other in MIT/UCB.
The real "experts" had been handed a free operating system that AT&T
couldn't sell because of antitrust issues.  IBM spent literally everything
it had to keep Unix off the market for as long as possible, including
paying blood money to Bill Gates for a crippled operating system for it's
Personal Computer.  By 1992, they had lost the battle.  SUN was grabbing
market share in the server market and Windows 3.0 was outgrowing it's
"Terminal with a Disk Drive" paradigm.  By January of 1993, the giant had
fallen, the rest was blood letting.  By 1994, IBM had surrendered and come
back with and agressive Unix oriented strategy including AIX for platforms
ranging from PS/2 Model 80s (not a bad implementation actually) all the
way up to their multiprocessor ES/9000 supermainframes.

> It's clear that he rode the crest of the post war ``baby boom'' period of
> prosperity. OS development then meant hacking out some file routines in
> assembly language to fit into a 64K machine from DEC. In the ten year
> period between the mid 60's and mid 70's, you'd have to have been
> brain dead to not pick up clues about more advanced operating systems,

Remember, by the time Bill Gates had ported MITS BASIC to the Commodore,
Unix was floating around MIT, Berkely, and about 10 other good schools and
research centers.  Pandora's box had been opened and it couldn't be
closed.

> given all the resources that come with working for a major computer
> corporation, and the time on your hands. While Culter worked away on bullshit
> like RSX11 that nobody today remembers,

I remember RSX11.  We had to put it's disk pack into the RM-80 drive on
our PDP-11/70 when the DEC Service people came to town.  Because their
marketing people didn't want us using Unix.  We had 75 users on that
machine.  It had a whopping 512 kbytes on it, and 8 300 meg drives for a
total of 2 gig.  Of course, the 14 inch platters could only spin at 1800
RPM, giving an access time of 55 ms.  When Emacs came out, and about 40 of
us started using multiple windows, it got a little slow.  So we got a Vax
11/780, with 1 million instructions/second, 1 megabyte of memory and a
disk drive with a smart controller.  We could let 100 users use emacs, all
at the same time, for 12-16 hours/day.  They would knock us off for
backups.  We'd get real upset when the system crashed more than once/week.
If the system was down for an hour, that was 100 hours or about
$6000/outage lost, not including time to recover lost files.

We got BSD 4.3 and suddenly the entire system ran much better.  It seems
that a bunch of college students had been chasing bugs because their
system was having trouble supporting 100 emacs users.

> his peers Thompson and Richie gave the
> world a tour de force: a portable operating system written in a high-level
> language that they designed themselves, int basically their spare time.

Interesting thing too.  They started with a data switch as the heart or
"microkernel" of the operating system.  The concept of being able to give
as many users as many processes as they wanted was quite revolutionary.  I
remember when someone showed me how to use sed to go through all of my
files and change structure members and other trivial search/replace
functions that had previously taken days to do.  I wasn't sure I liked
unix up until that point.  Suddenly I saw the real power of Unix.  I
actually went through the man pages on command at a time and learned each
one, after hours.  It was amazing, especially the new programming language
like awk, lex, and yacc.  It was like entering a whole new dimension.

> Cutler is far from the genius that zealous NT advocates make him out to be.
> Look at Mr. Torvalds.  He produced a working OS with features that Cutler
> could have only dreamed about even when working on VMS, and he did it well
> before graduating with a bachelor's degree.

Let's be fair.  Mr Cutler had to rely on the support of a handfull of
inbred corporate programmers who were upset about being taken off their
RT/11 operating system.  Linus turned his newborn child over to the care
of several hundred of the most talented superhackers in the world.  The
contributor's list reads like the Who's Who of the ACM and the IEEE.

> Incidentally, I, in turn, have a question about NT: how does one uninstall the
> assholes it comes with?

See subsequent article by same author.

> -- 
> 
> 
> 

	Rex Ballard - Director of Electronic Distribution
	Standard & Poor's/McGraw-Hill
	Opinions expressed do not necessarily reflect
	the Management of the McGraw-Hill Companies.
	http://cnj.digex.net/~rballard





From rballard@cnj.digex.net Fri Jul  5 11:55:48 1996
Status: O
X-Status: