2
$\begingroup$

DISCLAIMER: The following scenario was taken from an assignment I got in a OS course I'm taking, and it arose a lot of question marks in my head. However non of the questions asked by myself here reflects a question that I'm supposed to answer (alone) as part of the assignment. What I mean is: I'm not asking you to do my HW I'm just asking for help to better understand the concepts.

Given the following scenario:

  • A system using paging for memory management.
  • Physical memory size is 128MB
  • There are 4K frames in physical memory and each frame has 8K words.
  • Page table of a single process has at most 1024 entries
  • Virtual memory is not used.

    I know from the above that a WORD in such a system must be 4 Bytes long.

    Since virtual memory is not being used, I think it is possible that a process can get all the 4K frames if it requests them (assuming obviously that they're available for it when it's loaded) thus it can be allocated all of the available physical memory (128MB). However if Virtual Memory is used then the maximum amount it can get is 32MB because of the structure of the page table (1K entries, each entry has 8K words and each word = 4 Bytes). Is my conclusion correct or not? I reached it while reading Silberschatz, Galvin & Gane book (Operating System Concepts).

  • $\endgroup$
    3
    • 1
      $\begingroup$ 1. What do you think? What study/readings have you done? I suggest you edit the question to include that. We expect people to check standard resources (textbooks, Wikipedia, etc.) and do their research before asking here. 2. Those are a three separate questions. I would suggest posting a separate question for each conceptual question you have. You might want to edit this to focus on one of them and post 2 other separate ones. 3. What's the word size? What's the size of each address? (The latter is something you'd know in a real architecture.) $\endgroup$
      – D.W.
      Commented May 12, 2014 at 23:43
    • $\begingroup$ I agree, I'll split the questions. $\endgroup$
      – y0n1
      Commented May 12, 2014 at 23:45
    • $\begingroup$ regarding (3) word size is 4 bytes = size of each address as well $\endgroup$
      – y0n1
      Commented May 13, 2014 at 2:16

    1 Answer 1

    -2
    $\begingroup$

    The main point I think is here the usage of paging without implementation of virtual memory(VM) techniques.

    Nowadays it's rare, but once upon a time when the concept of VM was a dream paging was used for a different purpose. At that time the memory allocated to a process needed to be contiguous which usually lead to fragmentation (external) and hence bad utilization of memory. Then the concept of paging brought a revolution. Memory can be allocated to a process non-contiguously. The process memory space is divided into pages of same size. The Main Memory is also divided into same size frames and page size is equal to frame size. Page table of a process keeps track of the addresses of the frames. To be precise if the page table has $k$ entries it can have at most $k$ frames. For each frame, page table stores the starting memory address of that frame. Unlike the concept of VM all the frames need to be stored in main memory. Note that this might lead to another type of fragmentation (internal) as a process memory space size might not be multiplicative of page size. But, this is not that severe like the external one.

    So, here in your question I think they try to mean this kind of scenario, paging without VM. Thus here also it is possible to limit the size of a process by using the page table in the similar manner you mentioned in your question for the case where we use VM.

    But, my main concern is to convey the idea that we can indeed use paging without VM.

    $\endgroup$
    2
    • $\begingroup$ This doesn't answer the question that was asked by the poster. The poster asked how to figure out how much memory can be used by a process, not "how do you use paging without VM?" (And I think you got the definitions of virtual memory and paging backwards. You are describing the use of paged virtual memory without backing store.) $\endgroup$ Commented May 13, 2014 at 11:32
    • $\begingroup$ I think this answer his questions though indirectly. I would give stress more on understanding related concepts rather than giving straight answer to a question. @Janos mentioned a scheme for limiting process size in presence of VM based on argument of limitation in number of page table entries. And, that is good. But, what he was missing is that he thought without VM the page table argument doesn't work. That's why I gave stress on the point that even without VM techniques you can use paging. Thus here also we can bound the process size based on the same page table entries argument. $\endgroup$ Commented May 13, 2014 at 14:25

    Your Answer

    By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

    Not the answer you're looking for? Browse other questions tagged or ask your own question.