System Resources and Their Limitations Across Device Types
IB Computer Science · Resource Management (HL)
The resources a system has. Every computing device is a bundle of resources that can run out: primary memory (RAM, where running programs and their data live); secondary storage (disk or flash, persistent but slow); processor speed and number of cores; cache, the small fast memory that hides RAM latency; network bandwidth; screen resolution; graphics and sound processors, specialised chips that take work off the main processor; and, for anything not plugged into the wall, battery. The exam expects you to name these and, more importantly, to say what happens when each one runs out.
Different devices are short of different things. A mainframe or large server has huge memory, storage and processing, runs thousands of users at once, and has almost no screen because nobody sits at it; its constraint is heat, power and the cost of downtime. A desktop PC is balanced, with a large screen and mains power; its limits show as slowness when RAM fills. A tablet or phone has a capable processor but a small screen, limited RAM, limited storage, wireless bandwidth that varies with signal, and above all a battery, so every piece of software must economise on power and the operating system aggressively suspends background apps. A digital camera has little general processing and memory but a dedicated image processor and fast storage; it does one job. An IoT sensor may have a few kilobytes of memory, no screen, a slow radio, and a battery that must last years, so it wakes briefly, sends a number and sleeps. The same task — say, viewing a document — is implemented differently on each: the desktop loads the whole file into memory, the phone streams pages as needed, the sensor could not do it at all.
Bottlenecks. Performance is set by whichever resource runs out first. A server at 96% processor use with idle disks needs a faster processor; one at 30% processor with a saturated disk and a high page-fault rate needs more RAM, and a faster processor would change nothing. Diagnosing the bottleneck before spending money is the skill examiners test: they give measurements and ask which upgrade helps. The rule is that upgrading any resource other than the bottleneck produces no improvement, and after the bottleneck is removed a different resource becomes the new one.
Consequences for software. Software written without regard to limits fails in predictable ways: an app that keeps a large data set in memory crashes on a phone; a page that assumes broadband is unusable on a slow link; a program that polls a sensor constantly drains the battery. Good design measures the target device's limits and works within them — loading lazily, compressing, caching, batching network requests and letting the device sleep.
Worked example: Example 1 — diagnosing the bottleneck from measurements and choosing an upgrade
Three servers have peak-hour measurements. Server 1: processor 95%, disk 20%, page faults low, network 30%. Server 2: processor 35%, disk 98%, page faults very high, network 25%. Server 3: processor 40%, disk 30%, page faults low, network 99%. For each server state the bottleneck, the correct upgrade, and one wrong upgrade that looks reasonable.
Solution
Server 1 — the processor. 95% processor with everything else idle means the work is purely computational. Correct upgrade: a faster processor, or more cores if the software can use multiple cores. Wrong upgrade that looks reasonable: more RAM — RAM is sufficient because page faults are low, so adding more changes nothing.
Server 2 — RAM, even though the disk is what is saturated. This is the trap case. Disk at 98% plus very high page faults is the sign of thrashing: RAM is insufficient so the operating system keeps moving pages in and out of the disk, and the busy disk is a consequence, not the cause. Correct upgrade: add RAM, after which page faults fall and the disk becomes idle by itself. Wrong upgrade that looks reasonable: a faster disk — it makes thrashing a little less slow but the machine still spends most of its time swapping pages; a faster processor is even more useless because the processor is 65% idle.
Server 3 — the network. 99% network with everything else idle: the server finishes processing but cannot push the data out in time. Correct upgrade: a faster network link, or reduce the amount sent by compression and caching on the client side. Wrong upgrade that looks reasonable: the processor or RAM, both idle.
General rule. Look at the highest measurement first, but ask whether it is a cause or a consequence — a busy disk from thrashing is the classic example of a consequence. And after removing one bottleneck, measure again, because another resource will become the new bottleneck; server 1, after getting a faster processor, may begin to saturate the network.
Worked example: Example 2 — the same application on three devices
A map-viewing application must run on a desktop, a phone and a smartwatch. For each device, state the two deciding limits and how the application must change to cope.
Solution
Desktop — the loosest limits. Mains power and large RAM allow preloading the whole city's map into memory and drawing at high resolution; a large screen allows many layers of information at once. The only practical limit is bandwidth for the first download, solved with a disk cache. The application can waste resources without the user noticing.
Phone — battery and fluctuating bandwidth. Two limits: battery, because GPS positioning and a bright screen are the two biggest power drains on a phone; and bandwidth that varies with signal, sometimes zero. The application must: download the map in small tiles around the current location instead of the whole city; cache viewed tiles for use when the signal is lost; reduce the GPS reading frequency when stationary; and respect the operating system suspending it when in the background. Limited RAM also forces dropping distant tiles from memory.
Watch — everything is scarce. A screen a few centimeters wide, memory of a few tens of megabytes, a small battery, and often no connection of its own. The application cannot draw a map: it only shows an arrow giving direction and the distance to the next turn, receives precomputed data from the phone over Bluetooth, and turns the screen off between turns. In essence this is a different application that only shares the purpose.
Marking point. A good answer does not say the phone is weaker than the desktop but names the exact limiting resource and ties it to a specific design decision. Limits determine the software architecture, not just make it slower.
Common mistake
Trap 1 — upgrading the resource with the highest measurement. A disk saturated by thrashing is a consequence of lacking RAM; you must ask whether it is cause or consequence.Trap 2 — saying a large server has the most of everything. It has almost no display, and its limits are heat, power and the cost of downtime.
Trap 3 — treating limits as only making software slower. Limits determine the architecture: load in pieces, cache, sleep — or it cannot be done at all.