Secondary Memory

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

Answer:

  • Where is the program you are running?
    • In main memory.
    • Running programs are always located in main memory.
    • A permanent copy will also be in secondary memory on the hard disk.
  • Where are the characters you have typed?
    • In main memory.
    • When you "save" your document, the characters are copied to a file on the hard disk.

Secondary Memory

Secondary memory is where programs and data are kept on a long-term basis. Common secondary storage devices are the hard disk and optical disks.

  • The hard disk has enormous storage capacity compared to main memory.
  • The hard disk is usually contained inside the case of a computer.
  • The hard disk is used for long-term storage of programs and data.
  • Data and programs on the hard disk are organized into files.
    • A file is a section of the disk that has a name.

A hard disk might have a storage capacity of 500 gigabytes (room for about 500 x 109 characters). This is about 100 times the capacity main memory. A hard disk is slow compared to main memory. If the processor interacted with it directly the entire computer system would slow down. The reason for having two types of storage is this contrast:

Primary memory Secondary memory
  • Fast
  • Expensive
  • Low capacity
  • Works directly with the processor
  • Slow
  • Cheap
  • Large capacity
  • Not connected directly to the processor

QUESTION 7:

Say that you have purchased the game Doom IV and have installed it on your computer. The game consists of

  • A program (that controls the action of the game)
  • Data (the images and other information)

After installation, where is each of these parts located in your computer system?