0

So a single process will have 2^32 bytes address space, isn't that too big?

If the address space of a single process is that's big, won't it cost too much time swap-in/out between main memory and backing store? And if a single process has 4GB address spaces allocated, how many space can other process have?

I'm reading Operating System Concepts, 9th ed., Silberschatz, Page379.

4G?

4
  • Too big for what? Why do you consider it a problem? Please edit your question, it's unclear what you're asking.
    – gronostaj
    Jul 31, 2018 at 6:50
  • Paging works on the page level. The details of what makes a process is specific to every operating system, though most have some common points. // Also, you might want to (further) research virtual memory. Address space != consumed memory
    – Daniel B
    Jul 31, 2018 at 7:11
  • @DanielB: So in the text, 4 GB is the theoretical maximum for each process, but not necessarily like that and the details are left to OS, is this correct?
    – Niing
    Jul 31, 2018 at 7:13
  • It’s only 4 GB in 32-bit operating systems anyway. But yeah, the OS can impose arbitrary limits in addition to technical limits.
    – Daniel B
    Jul 31, 2018 at 8:10

2 Answers 2

1

At the end of the 32 bit era, the 4gb RAM cap was really starting to be felt. Take for example the fact that many computers from the early 2000s were shipped with 512mb or 1gb of system RAM, which was already nearing the limit imposed by the 32 bit space. Not only are 32 bit applications limited to 4gb of memory, the entire system was, which coupled with a single core processor would kill multitasking. Now computers operate as 64 bit systems, allowing a theoretical 18.4 exabytes of RAM. Many if not all common programs today (excluding workstation applications) use near or less than 4gb of RAM (many are 32 bit applications complied to work in a 64 bit space. ) So while 4gb RAM may seem like a lot for a program ( and in the case of your VAX machine, a theoretical limit imposed by design, while in reality the available memory to each program was much much less), and in some cases still is, the Advent of multitasking and computer graphics and designe hastened the need for 64 bit computers. (Hope this answers your question, which I believe to be saying that a 32 bit address size is very large and unnecessary rather than impossible) A process can have up to, not necessarily always, 4gb of RAM allocated

0
1

won't it cost too much time swap-in/out between main memory and backing store?

No, because memory for processes are pushed out to disk as "pages" which are typically 4KB in size. We don't push out the entire address space of a process in one go. You are correct in believing that doing so would be cumbersome and quickly result in massive amounts of data being written to disk.

Most processes don't allocate all of their allotted 4GB address space, they only request small amounts of memory as needed. Again writing out the entire address space would be a waste as most of it would be empty.

if a single process has 4GB address spaces allocated, how many space can other process have?

Each process has its own address space which is separate to every other process. The OS separates processes into their own address space and translates virtual addresses into physical memory addresses with the assistance of the CPU. In effect every process is a new "virtual" address space with allocated memory being backed by physical RAM.

Physical memory is never truly addressed by a program, data is written to memory sure, but the actual address that a process writes to is a virtual address that is translated into a physical address.

Not the answer you're looking for? Browse other questions tagged .