I don’t know how well running themes are liked here, but I have another thematic three-parter for you, all focused loosely on the concept of being “locked up.” I am taking my first legitimate business trip this week, (old hat for many of you, I’m sure), and the next two articles will revolve around my experiences in as much as I can talk about them, (part of the “fun” of this trip is that I’m not allowed to talk about some of it, so you can begin to see where “locked up” comes into play). But this week I’m beginning with my preparation. I’ve spent the last many weeks cranking out experiments and tests and a common problem was that I would set something up that was doomed to hog too many resources and slow my computer to a crawl. This week is a practical discussion of what can cause a machine to “lock up” and operate so slowly that it becomes impractical to use it.
It used to be that making your computer go slow was as easy as booting it up and trying to run something. Web browser, eh?, your computer would say, sounds complicated. Now, common usage needs have been outpaced by available resources, (Smart phones and tablets are more or less proof of this; it seems today you don’t need a faster computer, you need a smaller, slower one). But everything still goes to molasses every once in a while. What is happening? Can anything be done?
I explained the complexity of multi-core processors some time ago. Assume for a moment that it is 1998 and you only have the one processor in your CPU. In 1998 you can do more than on thing at a time, right? Only one processor but your machine is running the operating system and your word processor and that calculator and a clock and maybe you have a web broswer open. The point is, despite having only one processor, your machine gives the illusion of having several. Remember that processors process billions of instructions per second, (in 1998 is was mere millions, but still). What is happening is that the CPU juggles between several tasks at once, cycling through them fast enough that you can’t tell that only one at a time is getting a slice of the processor pie. Switching back to today, well, in truth you are still running more tasks than you have processors. Always have, always will.
As usual I am simplifying the issue, but maintaining the potential bureaucracy of giving these tasks their fair share is itself another time consuming task. And not all tasks are equally rigorous. In simple terms, you can think of each program you run as having some amount of instructions-per-second that it needs to maintain before it will visibly run slower than it should. The CPU only has so many instructions per second to give, plus it loses a little to bureaucracy. You ask it to do too many things and before long, none of them are performing satisfactorily. The “bureaucracy” element assures that this is usually a net loss. It is sometimes worse to do five things simultaneously-but-slowly than it is to do them in succession, one at a time, quickly.
Today’s operating systems, (pick any of them), have a utility that shows you a list of processes that are currently being run, and often includes a percentage estimate of how much CPU time it is eating up. If your computer has slowed down, and you are running many things, check this utility out and see if one program consistently hogs your CPU. This would be an indication that that program might need to be run in isolation.
So I need to spell out the standard memory dichotomy, but my need to be technically correct is going to get in the way a little. Most everybody has a solid, practical understanding of the “two types” of memory on your machine: “RAM” or “temporary memory” that is used to keep track of what the machine is currently doing, and “long term memory” where your files and such are stored and persist even when the machine turns off and/or doesn’t currently care about them. More accurate is to say that memory serves two purposes on a personal computer, and that for practical reasons there are indeed two “types” that more or less get assigned to each function. However, all of your memory is RAM in that RAM stands for random access memory and refers to the ability of your computer to access any of it at any time and do whatever it wants to with it. (Word count is preventing me from further rambling down a few rabbit holes here; fighting over this technical distinction probably isn’t worth it).
Anyway, the function-over-type distinction is important because there is nothing that prevents your computer from using your hard drive as temporary memory too. Colloquially this is called “Virtual RAM”, (sigh). Anyway, a common misconception is to look at this feature and assume that instead of 2 GB of RAM, you have 6 because your computer is setting aside 4 “virtual” gigs. So which is it? Is it all the same or isn’t it? Like I said you do have two types of memory hardware: fast and expensive, (What is typically called RAM and used for temporary things), and slow and cheap, (Your hard drive). Once your computer begins to use the “virtual memory” in any large capacity, life as you know it is over. People understand that a hard drive is slower, but I think the magnitude is lost on them because it still works on the order of milliseconds and once you say “milliseconds” people begin to wonder why we are so impatient in the 21st century.
Different hard drives do have different performance measures, but let’s say we slowed computers down to a speed where we could comprehend what was happening. If it took 10 seconds to manipulate information in RAM, it would take 150 days to manipulate something on your hard drive, (This figure can be debated depending on your hard drive, but the magnitude is correct).
Heavy use of the hard drive for memory is referred to as “thrashing” because not only is the hard drive slow, but once it has no choice, it is constantly having to swap out things from RAM and your hard drive, making the number of hard drive accesses skyrocket. If things have bogged down, you are likely out of RAM, (Or, more generally, you are likely using your hard drive – opening or saving large files can take a lot of time too, right?). Again, you have a utility that tracks resource usage. Be aware of what eats up a lot of RAM and run it in isolation in the future.
Today, you most often experience slowness when using a web browser. If accessing your hard drive is already a bottleneck, it isn’t hard to understand that accessing someone else’s hard drive three planets over is significantly worse. For the most part, people accept that loading a new webpage will take a few seconds, sometimes more. Extraordinarily slow behavior, (Or even “won’t load at all” behavior), is a good indication that something somewhere is wrong. Some people avoid some basic trouble shooting steps to find the source of the problem, however. With Internet usage, there are so many links in the chain where the apple cart can turn over. In general you want to know if it is “your end” or “their end.” When the web browser gets slow, try loading pages from other sites to see if the site you are accessing is to blame. If you are in an office, have other people try to access the same site, or other sites, as their success can possibly narrow it down to your computer. If nothing works well office-wide, then you have large scale problem on your end, either your network or your service provider are having some sort of hiccup. On the other side, if a particular site doesn’t work, relax and try again later. Traffic to sites can cause this slowness, as well just plain old technical problems on their end, (they lose Internet too).
Next week: A little more exciting. I will talk about not being able to talk about things.