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
2 votes
1 answer
88 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 ...
user16217248's user avatar
0 votes
0 answers
18 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
48 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
157 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
91 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
19 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
43 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
64 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
17 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
0 votes
0 answers
33 views

Page-to-Cache mapping

I have a computer architecture exam tomorrow and my professor gave us some questions for practice. I just need to clear some confusions. The first question is: "a) In a Direct-Mapped Cache, ...
Shayan Shamsi's user avatar
0 votes
0 answers
83 views

How to calculate page number of pages and page size for multilevel paging?

I have the following virtual address: +---------+----------+----------+ + 7 Bit x | 13 Bit y | Offset d + +---------+----------+----------+ I now have the ...
David Krell's user avatar
2 votes
1 answer
585 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
35 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
138 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
41 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
50 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
161 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
242 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
463 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
241 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
83 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
461 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
506 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
142 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
4k 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
81 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,018
1 vote
1 answer
83 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
  • 349
1 vote
1 answer
79 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
72 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
509 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
604 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
234 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
120 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
217 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
470 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
0 votes
2 answers
389 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
  • 103
1 vote
0 answers
201 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
5k 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
590 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
147 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
657 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
0 votes
1 answer
155 views

can virtual address map any on virtual memory on disk?

I was reading a textbook which says that: If the valid bit is set, the address field indicates the start of the corresponding physical page in DRAM where the virtual page is cached. If the valid bit ...
secondimage's user avatar
1 vote
1 answer
175 views

How does virtual memory work when it need to save data in physical memory into disk?

I'm reading a textbook which desribe VM as: a data structure stored in physical memory known as a page table that maps virtual pages to physical pages. The address translation hardware reads the page ...
slowjams's user avatar
  • 113
0 votes
3 answers
319 views

How does the OS handle multiple stacks in its physical memory?

Without assuming ASLR... Processes have virtual addresses, and they manage stacks & heaps of their own. However, these all get mapped to physical addresses somewhere on the memory. Let's say we ...
Alex Coleman's user avatar
0 votes
1 answer
144 views

Virtual Memory vs Cache for block identification

Both are based on the principle of locality. Then why virtual memory uses table lookup while cache memory uses associative memory for block identification?
Www's user avatar
  • 73
0 votes
0 answers
187 views

Source code or detailed explanation of "WKS" virtual memory compression algorithm?

I've been trying to find information on various program data virtual memory compression algorithms that are in the "WK" family of algorithms. So far, I've been successful with the "WKdm" compression ...
jdb2's user avatar
  • 1
1 vote
1 answer
499 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