# Maximum amount of memory that can be allocated to a process

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).

• 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.)
– D.W.
May 12, 2014 at 23:43
• I agree, I'll split the questions.
– y0n1
May 12, 2014 at 23:45
• regarding (3) word size is 4 bytes = size of each address as well
– y0n1
May 13, 2014 at 2:16

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.