Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [virtual-memory]

Questions about techniques for providing the appearance of an isolated, contiguous address space to each process. The size of the address spaces may be made to appear larger than the size of main memory by moving pages or segments between main memory and a larger backing store.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
9 views

How can I solve this Address Translation and Virtual Memory problem? [closed]

A computer uses a 4-level hierarchical page table for address translation with a 64-bit virtual address space and 4 KB page size. Each page table entry is 8 bytes. a) Calculate the size of each page ...
Lonely Taipan's user avatar
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

relationship between page table size, patge table entry and pagt table base register alignment

I am trying to understand this question from Prof. Onur Mutlu's assignment solution on virtual memory. I am reproducing the problem and solution followed by my question: Problem: A dedicated computer ...
Singh's user avatar
  • 1
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
1 vote
0 answers
31 views

How does virtualization handle modern TLBs?

In an answer to this question: For instance, modern Intel TLBs have a process context ID (PCID); each TLB entry is tagged with the PCID of the process that the page mapping is for, and the processor ...
whoisit's user avatar
  • 165
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
1 answer
20 views

Cache Miss in First Private Cache but Hit in Shared LEvel 2 Cache: Does it Result in a Penalty?

In the context of Shared Memory Multiprocessor (SMP) systems with different cache levels, if a cache miss occurs in the first private cache but is followed by a hit in the second shared cache, would ...
First_1st's user avatar
1 vote
1 answer
99 views

Can a MMU be emulated entirely in software?

I'm curious about the viability of creating memory isolated processes on a processor without an MMU. While it would be inefficient I'm wondering if it's possible to basically create a virtual machine ...
FourierFlux's user avatar
2 votes
1 answer
133 views

What is the reason or motivation for having 128-bit pointers?

I read here that the reason that intptr_t and uintptr_t are optional in C is because there might be a platform where pointers ...
CPlus's user avatar
  • 207
0 votes
0 answers
19 views

Secondary Memory Data Structures and allocation strategies for intermediate query results

Despite a huge amount of literature regarding table representation and indexing in secondary memory (also including database books), I found no information on how relational databases represent ...
jackb's user avatar
  • 101
0 votes
3 answers
86 views

Page fault, virtual memory

I am reading the book: Digital Design and Computer Architecture: ARM Edition I am on the chapter about virtual memory. I am wondering, when a page fault occurs, is it the processor or the OS that &...
user394334's user avatar
0 votes
3 answers
193 views

Why do we still need virtual memory in 21st century?

AFAIU, there are only two issues, that VM solves: Scarcity of RAM; Access control to "unknown" memory, where SW tries to read from or write to the memory it does not own or share with other ...
Student4K's user avatar
  • 101
3 votes
1 answer
155 views

How does the OS track Reference Counters in Copy-on-Write forks?

I'm trying to modify xv6-riscv to perform a copy-on-write mapping when executing fork(), but I'm struggling to determine a concise way to manage the copy-on-write ...
VanceR's user avatar
  • 33
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
58 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
125 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
2 votes
1 answer
846 views

Question about Context Switching

I'm reading OSTEP for my Operating Systems course, and I have a question from Chp.6.3: Note that there are two types of register saves/restores that happen during this protocol. The first is when the ...
user129393192's user avatar
0 votes
2 answers
39 views

Executable linking/loading workflow

I'm having a bad time understanding how multiple concepts work simultaneously for achieving linking/loading correctly an executable. From the very beginning loading/linking is basically the art of ...
ca-hercor's user avatar
0 votes
2 answers
151 views

Is there an adress in the hard disk for each virtual adress?

Is it so that for each virtual adress there exists an adress in the hard disk? But the hard disk can be larger than the virtual memory? EDIT: Or can some virtual adresses always map to physical, and ...
user394334's user avatar
0 votes
0 answers
48 views

How does the computer keep track of which physical pages are used?

My book(link) says that if the computer tries to access a virtual memory page that is on the hard-disc it loads that page into physical memory. But how does the computer keep track of which physical ...
user394334's user avatar
0 votes
2 answers
53 views

Does the computer change the content of the virtual adress

My book(digital design and computer architecture ARM edition) explains loads and stores like this: To perform a load or store, the processor must first translate the virtual adress to a physical ...
user394334's user avatar
0 votes
1 answer
436 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
521 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
1 vote
1 answer
682 views

Page/Frame VS Block

I am bit confused on these terminologies. While studying Paging of Operating System we study about Page and Frame. Size of one Frame of Main Memory = Size of one Page of a Process While studying ...
ANUPAM's user avatar
  • 27
0 votes
2 answers
332 views

If a process needs more RAM, does the Page size simply get bigger or does it get a new page?

Let's say I have a Operating System with 4KB page size, but I need to allocate 8kb of memory for all the variables. Does the Process get new page (second one) or does the current page table simply get ...
Lordoftherings's user avatar
1 vote
1 answer
103 views

How are frames split up in an inverted page table?

For an inverted page table, it's number of entries = number of frames in main memory. One frame in the main memory, could be shared by two (or more) processes, say process A and process B. Usually ...
CoderMath's user avatar
3 votes
1 answer
572 views

Buddy system allocator and slab allocator in Linux kernel

In the Silberschatz's book "operating systems" the author talks about the allocation of memory via system buddy and slab. My first question is: in the book, both memory allocation methods ...
Bender's user avatar
  • 367
0 votes
1 answer
653 views

Number of bits for physical address and virtual address

According to my understanding a 32-bit machine determines the number of bits of physical address as 32 bits , and hence , we can address a physical memory space of 4GB. So the number of bits of ...
John adams's user avatar
0 votes
0 answers
166 views

Definition of the term "access efficiency" in the context of computer systems

In a two-level virtual memory, the memory access time for main memory, $t_M=10^{−8}$ sec, and the memory access time for the secondary memory, $t_D=10^{−3}$ sec. What must be the hit ratio, $H$ such ...
Abhishek Ghosh's user avatar
11 votes
3 answers
5k views

Why is a 4 KB alignment requirement imposed on Intel Core i7 page tables for Linux

I'm reading CSAPP and couldn't wrap my head around this part: Summary of what the section says: Intel Core i7 support a 48-bit virtual address space and 52-bit physical address space. Core i7 uses a ...
Nicholas Humphrey's user avatar
2 votes
0 answers
104 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
1 vote
1 answer
98 views

Timesharing and the MMU

Imagine we are running a program on a modern operating system, such as Linux or Windows. After running for some time, the program's time slice is up. A different program (process) starts to run again. ...
Bob's user avatar
  • 359
1 vote
1 answer
164 views

Is possible applying virtual memory with cloud disk (cloud storage) instead of local disk (SSD/HDD)?

I heard concept of virtual memory is using disk to save temporary progress or data instruction (temporary data). About temporary data, it's main job of physical memory (RAM) so that's mean virtual ...
Muhammad Ikhwan Perwira's user avatar
-2 votes
1 answer
176 views

What is the reason for this contradiction about the size of the char type?

the size of one char in C is 4 bytes, however to define an 'A' character we use the sum of two values like this expression here: or in other way i want to say that the char is 4 bytes size, but in ...
meddhiaka's user avatar
0 votes
1 answer
621 views

How is segmentation a solution to external fragmentation

As per Galvin's book, segmentation is the solution to external fragmentation. But in segmentation, the memory blocks are of different sizes. So, if one segment is removed that creates a hole. If we ...
RAMSANKAR HAZRA's user avatar
1 vote
2 answers
812 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
2 votes
1 answer
335 views

How LRU is used without special hardware?

I had been curious as to which page replacement algorithm is used in OSes like Windows and Linux. I could find that most information on the internet pointed at LRU(Least Recently Used) Algorithm. But ...
Yuv's user avatar
  • 139
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
2 answers
264 views

Are the number of entries in the TLB(Translation Lookaside Buffer) limited?

If not, then why aren't all the pages loaded into the TLB so that TLB misses never happen.
Yuv's user avatar
  • 139
0 votes
1 answer
575 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
2 answers
506 views

Find offset and page number given paged virtual memory address

I ran into this question in class: Assume a machine that is 64-bit and has 8GB memory. They use a paged virtual memory where the page size is 4KB. You run the following program: ...
Melanie's user avatar
  • 113
1 vote
0 answers
217 views

Calculating physical address from Logical Address

I have been give a page table logical address of 0011 0110 1010 1010 and have been told that there are 512 entries into this page table in which the frame number is two times smaller that the page ...
user131882's user avatar
1 vote
2 answers
6k views

How do I calculate offset from virtual address?

If the page size is 4Kbyte and the physical size of the main memory is 32Kbyte. Now if I consider virtual address of 37064.. The page number is then 37064/4096 = 9 And according to my diagram page 9 ...
foms's user avatar
  • 11
0 votes
1 answer
694 views

Number of hardware page tables and page directories kept in the MMU

How many hardware page tables (physical) and page directories are kept in the memory management unit? If a cpu has a 32 bit virtual address, the upper 10 bits are used for the page directory, the ...
Road's user avatar
  • 41
0 votes
1 answer
168 views

Segmented address / normal virtual address

In a cpu with segmented memory, can an address only be accessed with a segmented address, or can a normal virtual address also be used?
Road's user avatar
  • 41
2 votes
2 answers
800 views

How are programs split up into pages in Memory Paging?

I am a bit confused about how the logical addresses are generated in a paging memory architecture and where and when a program is split up into pages. I understand how logical addresses are translated ...
Kartheyan's user avatar