Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [paging]

Questions about memory-management techniques where the computer manages and transfers data between main memory and secondary storage in pages -- discrete chunks of a fixed size. Operating systems often use paging to implement virtual memory.

Filter by
Sorted by
Tagged with
1 vote
1 answer
50 views

Are they talking about virtual memory in this article?

I am reading this Wikipedia article: https://en.wikipedia.org/wiki/Memory_segmentation And I am in this paragraph: Segmentation with paging Instead of a memory location, the segment information ...
user394334's user avatar
0 votes
0 answers
17 views

Size of page Table entry

The following question was asked by our professor in exam:- Given a system with 4GB virtual address space and page size 4KB and total physical RAM of size 8KB. What will be the size of the page Table ...
Arpan's user avatar
  • 1
0 votes
0 answers
34 views

Why can't a single-level page table grow dynamically?

I'm reading about page tables in Patterson & Hennessy's Computer Organization and Design RISC-V Edition. The excessive memory usage of a single-level page table is noted w/: with a single level ...
Tianxiang Xiong's user avatar
1 vote
0 answers
35 views

Who and how generate the virtual/logical addresses? Confusion if it's the compiler, the linker, the loader

I know that when I compile a program and then I inspect with objdump, I have addresses. These are relative addresses. But if it's a C program and I printf with <...
Allexj's user avatar
  • 111
0 votes
1 answer
63 views

Do I need a multilevel page table in the following design?

I am practicing paging in virtual memory and came across a question with the following details 44-bit address space 16KB page size 16 Bytes Page table entry (PTE) If I understand paging correctly ...
kate's user avatar
  • 11
0 votes
2 answers
46 views

When a CPU copies instructions from storage into RAM how does it jump to instructions no longer in RAM?

When a CPU needs to get more instructions from storage and copies them to RAM, how does the CPU jump to previous instructions that are no longer in the RAM? Would it have to copy the old instructions ...
Thenboy's user avatar
  • 11
-1 votes
2 answers
28 views

Which searching technique will cause lesser number of page fault?

Linear Search has O(n) T.C and Binary Search have O(logn) T.C. But how come Linear Search generates fewer page faults? Is there another searching technique that causes a lesser number of page faults ...
Vedant Khandelwal's user avatar
1 vote
0 answers
66 views

How is the physical address calculated in Page tables?

Taking an example, say we have Page size = 4KB, Page Table Entry = 4B, Physical Address Space requires 36 bits In 3-level multi-paging, let's say the number of entries in the level 3 page table is 2^9 ...
parsingstreet's user avatar
0 votes
0 answers
25 views

What if the size of the logical address is not power of two?

If the logical address and the page size are power of two, then we can separate the virtual address into two parts: page number and offset. Is this still valid if the virtual address is not power of ...
AAA's user avatar
  • 43
0 votes
0 answers
24 views

Physical memory address space

When you address physical memory, in the kernel, is it just another value like 0xf78f9 just like virtual addresses (and the only thing that is different is that the ...
user129393192's user avatar
0 votes
1 answer
59 views

Memory (physical addressing)

From my understanding, physical memory (main memory -- DRAM) is addressed differently than disk. This is all a bit of an abstraction to me, and I am hoping to make my understanding more concrete. ...
user129393192's user avatar
0 votes
1 answer
129 views

Page allocation for a program

When my professor explained how the OS handles memory, he described demand paging, and how when a process starts up, the code page with the first instruction is loaded into memory, and everything else ...
user129393192's user avatar
0 votes
0 answers
35 views

An excercise on Pagin and Page tables

I have an exercise on paging and page tables that I can't get my head around. So the data is: my virtual addresses are 32 bits long, 1 page is 1 KiB, 1 PTE is 32 bits big and 1 page table is 1 page. ...
Christoph Sanders's user avatar
3 votes
1 answer
97 views

How does caching, paging, virtual memory, and OS all tie together for UNIX copy-on-write?

In my OS course, the instructor mentioned the following: In UNIX if a parent process creates a new child ("fork") then the child is an exact duplicate of the parent. This means its memory ...
Mohammed Arshaan's user avatar
0 votes
1 answer
449 views

What is the relationship between virtual address and physical address?

I am recently studying the operating system, and I found the paging system a little bit confusing, for example, what will happen when there is a 52-bit virtual address and a 40-bit physical address, ...
Eric's user avatar
  • 17
0 votes
2 answers
528 views

How many bits are needed to reference physical vs virtual addresses?

I trying to learn about virtual memory at the moment and one of the explanations I've look at has a diagram like below. You can see that 32 bit virtual addresses are used so the virtual address space ...
jaduuuui's user avatar
0 votes
2 answers
993 views

Calculate Physical Address Corresponding to Logical Addresses

Consider a logical address space of 4096, page size = 1024 physical memory = 8192 $\begin{array} {|c|c|} \hline \text{Page No} & \text{Frame No} \\ \hline 0 &7 \\ \hline 1 &4 \\ \hline 2 &...
Pasan Karunarathna's user avatar
0 votes
0 answers
55 views

Question Regarding number of frames required for multilevel page tables

I have a problem and I'm not sure where I am going wrong with this, description so as you can see it is given a 3 level paging system with 8 bit page index on every level, now I break down logical ...
Pawan Nirpal's user avatar
2 votes
0 answers
105 views

Exceeding limits of virtual address space

I still am confused whether I am asking the right question but here goes Consider a X bit processor. It can address theoretically a main memory of 2^x bytes(assuming byte addressable). Now consider an ...
Rinkesh P's user avatar
  • 1,024
0 votes
1 answer
84 views

Can Operating system allocate a page of process to any free frame in memory?

Consider I have a user program of 6 pages and 4 byte page size. Now my memory has 300 frames out of which 10 frames are free for allocation. Can the OS allocate page 1 of the given process to any of ...
Owl0223's user avatar
1 vote
2 answers
828 views

How could a page be invalid in demand paging?

I was reflecting on what I learned about demand paging and I have a question: In demand paging, we have entries in the page table only for frames that are present in physical memory. So I was ...
tonythestark's user avatar
2 votes
3 answers
4k views

Why does page size affect page table size?

I am revising operating systems theory (I'm Italian, forgive me for bad English) and there is a slide that states: If page size is small then we avoid internal fragmentation (I get that) but we have ...
tonythestark's user avatar
0 votes
2 answers
1k views

Understanding how internal fragmentation occurs in systems using only paging with huge page size

The excerpt below is from the OS text by Galvin et. al. When we use a paging scheme, we have no external fragmentation: any free frame can be allocated to a process that needs it. However, we may ...
Abhishek Ghosh's user avatar
0 votes
1 answer
243 views

Are Paging and page cache the same in Operating system?

I was looking at paging in OS. It seems like there are two concepts with the same name but with different features, and I wanted to be clear about those, Paging and page cache. Before I thought paging ...
sy choi's user avatar
0 votes
1 answer
132 views

Are pages moved to the disk when the process is scheduled?

When process A has run long enough and the scheduler decides to run process B, will all the pages of process A be moved to the disk or they remain in the main memory?
Yuv's user avatar
  • 139
0 votes
1 answer
581 views

Where are process pages stored - in the swap space or under file system? Can demand paging work without space space?

The Galvin OS text says that on older systems, there used to be a method, where the entire running process (when in idle state) was moved from the main memory (when main memory ran low) to the disk ...
Abhishek Ghosh's user avatar
1 vote
0 answers
46 views

How could one construct a TLB so that not all the bits of the presented address need match to result in a hit?

I was wondering besides the typical matching of all bits in the presented address to the resulting page, is there another way of doing so? what are the benefits/ cons and how would one go about doing ...
I'veGotSomeQuestions's user avatar
1 vote
1 answer
2k views

How page table base register (PTBR) is used to locate the correct frame using Page Number?

I was reading about paging in OS , and one of the things I saw was the page table base register (PTBR). If the CPU generates a logical address (Consists of Page number + Offset) it needs to be mapped ...
Colin Jack's user avatar
4 votes
1 answer
1k views

Why do we need hashed page tables for Paging in Operating Systems?

I understand that we might need hierarchical paging to handle page tables with sizes greater than the size of one frame, but what is the use of Hashed Page tables then? I would understand if we were ...
Soumya Sen's user avatar
2 votes
1 answer
97 views

Paging only for user code. What about kernel code?

Why is paging done only for user code (user space)? I know that the basic intuition behind paging is for managing larger logical address space in smaller physical main memory space. Won't the kernel ...
Nascimento de Cos's user avatar
0 votes
1 answer
994 views

When is it best to use the second chance replacement algorithm?

I'm going through 'Operating Concepts' by Silberschatz, Galvin and Gagne (The Dinosaur Book) and it mentions the Second-Chance Algorithm (not enhanced) as an improvement on the FIFO replacement ...
selfstudy777's user avatar
1 vote
1 answer
585 views

Is physical pages zeroed out before it's mapped to a virtual page?

I don't how this works. According to me if the physical memory is not cleared then there is some security risk as there may be some sensitive information in it from the other processes. How does the ...
Athul P's user avatar
  • 13
5 votes
1 answer
798 views

How does a TLB lookup compare all keys simultaneously?

I am reading OS Concepts dinosaur book which says, "Each entry in the TLB consists of two parts: a key (or tag) and a value. When the associative memory is presented with an item, the item is compared ...
mLstudent33's user avatar
1 vote
1 answer
522 views

Paging - access less than a page of memory

I'm having a bit of trouble understanding how less than a page of memory can be used. From what I understand, memory is given out in page size chunks - say pages are 4096 bytes, and 4 bytes are ...
johnramsden's user avatar
0 votes
0 answers
89 views

How many page-table entries are needed in case the program uses the whole logical address space

Say I have: page size = 2^12 bytes physical memory = 2^24 bytes logical address space = 2^32 How many page-table entries are needed in case the program uses the whole logical address space?
john gonidelis's user avatar
-2 votes
1 answer
744 views

Converting physical address to logical

In 8-bit address space there are 16 pages and the page table stores: 68792EA51BD3CF04 (hex) The physical address is 39h, what is the corresponding logical address? I have literally no idea what to ...
Shuubi's user avatar
  • 1
1 vote
1 answer
92 views

How are logical addresses of instruction operands mapped to physical addresses?

Is address translation for all operands in single instruction done only once and then are all operands fetched continuously? For example, consider any dummy instruction ...
RajS's user avatar
  • 1,667
0 votes
2 answers
2k views

Why does paging not have external fragmentation?

I have read that paging does not suffer from external fragmentation as the frames and the pages are all of the equal sizes, but when we store a last level page table in a frame at that time it may not ...
user avatar
0 votes
1 answer
1k views

Understanding paging and internal fragmentation

I am currently studing questions but stuck on this one, I hope someone can help me out to understand. Question: Assume that we have a paged virtual memory with a page size of 4Ki byte. Assume that ...
nihulus's user avatar
  • 115
2 votes
2 answers
3k views

Difference between present - absent bit and valid - invalid bit in a page table?

while reading I found this: Present/Absent bit – Present or absent bit says whether a particular page you are looking for is present or absent. In case if it is not present, that is called Page ...
vivek gupta's user avatar
2 votes
1 answer
961 views

What does it mean " The outer level page table need not be page aligned?

The question is in context to multilevel page table. I was trying to solve numerical on multi-level paging and noticed that page size might not be same at all levels. I came across the point "Outer ...
Amisha Bansal's user avatar
0 votes
1 answer
772 views

Multi-level Paging

Consider a system which has 2 level paging.The page table is divided into 2K pages and each page is having 4K entries.Memory is word addressable and Physical address space is 64MW which is divided ...
user3767495's user avatar
4 votes
1 answer
2k views

How does hashed inverted page table work?

I understand hash function and inverted page table, but then the book I read describes something called hashed inverted page table (use hash to accelerate the finding because IPT is large), with TLB ...
Kindred's user avatar
  • 314
1 vote
0 answers
577 views

pool of free page frames OS

I read that in a paging scheme memory management, some os's have a paging daemon that wakes up periodically to inspect the memory of the RAM. This is to ensure that modified pages can be scheduled to ...
calveeen's user avatar
  • 141
0 votes
1 answer
295 views

Page Replacement optimal verses MRU

A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. ...
Geeklovenerds's user avatar
1 vote
1 answer
5k views

How to find the virtual pages and physical memory frames?

So i am given a system of 20 bits virtual addresses and 18 bits physical addresses using paging with pages size 4Kbytes. I am told to find the maximum number of virtual pages that a process can have ...
Ian Twy's user avatar
  • 13
0 votes
1 answer
37 views

Linux OS/HW VM cooperation

From what i've learned, the HW is responsible for setting the accessed and dirty bits in the PTE of a process, and the OS is responsible for turning them off. My question is why? The first part, i ...
CodeHoarder's user avatar
0 votes
1 answer
3k views

What does "higher order address bits" and "lower order address bits" mean?

"Assume a system with 4 GB virtual memory and 1 GB physical memory with 32 bit addresses. if the page size is 4 KB, How many bits will be allocated as the Higher Order Address bits and Lower Order ...
Sankha Rathnayake's user avatar
1 vote
2 answers
361 views

Does the Working Set Paging Algorithm use a separate page table?

I am doing research on paging algorithms. While learning about the working set algorithm from several scientific sources I was not really able to figure out where exactly the working set is defined or ...
Thomas Christopher Davies's user avatar
1 vote
2 answers
900 views

What is the difference between a page and thread?

"Each process that is executed is divided into blocks of same size, called pages." "Thread is a part of process being executed." Are pages and threads both part(s) of process? Whats the difference ...
Peeyush Singh's user avatar