Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Perl CGl Programming: No experience required.
(Publisher: Sybex, Inc.)
Author(s): Erik Strom
ISBN: 0782121578
Publication Date: 11/01/97

Bookmark It

Search this book:
 
Previous Table of Contents Next


Installing the Right Amount of Memory

Deciding how much memory is adequate for your Web site’s computer is pretty simple: The more the merrier. The more RAM (random access memory) you can throw at UNIX, NT, or Windows 95, the happier they—and you—will be.

The memory is where much of what your computer does takes place. A program has to be loaded from disk into memory before it can run; its individual instructions and data are fetched one by one and executed by the processor. Thus, if you have a lot of memory installed, more can be queued up for the processor to do at a time and less has to be read from the disk. It is axiomatic that the slowest component of your system is your disk drive. You want to spend as little time rummaging through it as possible.

The three operating systems we’ve been discussing extend the computer’s abilities with a trick called virtual memory, in which the disk is treated as an extension of memory. If a program requires more memory than is actually available on the machine, its code can be paged out to the area of the disk that is set aside for virtual memory. Virtual memory effectively sets the amount of memory a program can use to the size of the disk if you’ve made that much of it available (not a wise policy, by the way).

However, every time the operating system pages code out to and back from the virtual memory on disk, it is calling on that slowest component of your system to do some work. Virtual memory allows you to run anything regardless of its memory requirements, but you pay a heavy toll in performance if you have so little memory that most of it winds up being virtual.

If you play with a computer with a relatively small amount of memory installed—say, less than 16MB—with Windows 95 or NT, and you crank up a bunch of programs that tend to hog memory (Microsoft Word in any of its versions is a good example), you will notice that things slow to a crawl from time to time, the mouse cursor may even hang or act jerky, and you can hear the disk being absolutely hammered. All of your programs will continue to run, but at interminably slow speeds.

This phenomenon occurs when your operating system is taking advantage of its virtual memory. The OS is paging code out to the disk, and then reading it back. That slowest component of the system is hanging things up.

Obviously, the best way to eliminate the problem is to add more memory. Besides, it’s ridiculously cheap these days, at least compared with what RAM sold for a few years ago, so there are no excuses for not packing your machine with as much memory as it will hold. Because of the memory demands of all three of our operating systems, and the way virtual memory works, you can often bring a moderately slow computer up to acceptable speeds just by loading it up with more memory. It can be cheaper than a processor or motherboard upgrade.


NOTE:  About half of this book was written on a 66MHz 80486 machine running Windows NT Server 4.0 in 16MB of memory. It was real slow. The other half was written on a relatively old multiprocessor computer with two 100MHz Pentiums driving Windows NT Server 4.0 in 64MB of memory. It was real fast.

An adequate basepoint is 16MB of memory, but if you can afford it, you really should go a lot further for your Web site. A heavily used UNIX system will be happiest with 64MB or more; NT Server, which due to Microsoft’s licensing restrictions is what you’ll need to run a Web server, doesn’t function well with less than 32MB; and Windows 95 is a real dog with less than 16MB.


TIP:  Windows NT Workstation allows only 10 connections to it at a time. You can easily overrun the restriction if you’re trying to run a Web site, the result being that visitors will be kicked out with a weird “security violation” error message. There are tricks you can play with the NT Registry to get around this restriction (see the O’Reilly & Associates Web site at www.ora.com for some pointers), but you’re really better off with the full NT Server package for your Web site.


WARNING:  The bus in a PC is the hardware that connects peripheral devices—including memory—with the microprocessor. In some older PCs, the bus architecture is incapable of handling more than 16MB of memory at a time. Any memory above 16MB has to be switched with the lower 16MB before it’s accessible to the processor. The process that does the change is called bank switching. It is faster than the code paging to disk involved in virtual memory, but it still slows things down considerably. Consult the documentation for your computer to see if you are saddled with the 16MB bus limitation. If you are, you may want to consider getting a new computer for your Web site.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.