Questions tagged [virtual-memory]

Virtual memory is a memory management technique developed for multitasking kernels.

This technique virtualizes a computer architecture's various forms of computer data storage (such as random-access-memory and disk storage ), allowing a program to be designed as though there is only one kind of memory, "virtual" memory, which behaves like directly addressable read/write memory (RAM).

1194 questions
297
votes
8 answers

Virtual Memory Usage from Java under Linux, too much memory used

I have a problem with a Java application running under Linux. When I launch the application, using the default maximum heap size (64 MB), I see using the tops application that 240 MB of virtual Memory are allocated to the application. This creates…
Mario Ortegón
  • 18,670
  • 17
  • 71
  • 81
152
votes
5 answers

Why doesn't this memory eater really eat memory?

I want to create a program that will simulate an out-of-memory (OOM) situation on a Unix server. I created this super-simple memory eater: #include #include unsigned long long memory_to_eat = 1024 * 50000; size_t eaten_memory =…
Petr
  • 13,747
  • 20
  • 89
  • 144
139
votes
6 answers

What are the differences between virtual memory and physical memory?

I am often confused with the concept of virtualization in operating systems. Considering RAM as the physical memory, why do we need the virtual memory for executing a process? Where does this virtual memory stand when the process (program) from the…
134
votes
10 answers

Why do x86-64 systems have only a 48 bit virtual address space?

In a book I read the following: 32-bit processors have 2^32 possible addresses, while current 64-bit processors have a 48-bit address space My expectation was that if it's a 64-bit processor, the address space should also be 2^64. So I was…
er4z0r
  • 4,711
  • 8
  • 42
  • 62
113
votes
2 answers

How does x86 paging work?

This question is meant to fill the vacuum of good free information on the subject. I believe that a good answer will fit into one big SO answer or at least in a few answers. The main goal is to give complete beginners just enough info so that they…
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
68
votes
7 answers

A simple "Hello World" needs 10G virtual memory on a 64-bit machine vs 1G at 32-bit?

Running a simple Java program on our production machine, I noticed that this program eats up more 10G virt. I know that virtual memory is not that relevant, but at least I would like to understand why this is needed. public class Main { public…
user3246431
  • 922
  • 1
  • 7
  • 12
67
votes
1 answer

Difference between sequential write and random write

What is the difference between sequential write and random write in case of :- 1)Disk based systems 2)SSD [Flash Device ] based systems When the application writes something and the information/data needs to be modified on the disk then how do we…
56
votes
4 answers

Why does the stack address grow towards decreasing memory addresses?

I read in text books that the stack grows by decreasing memory address; that is, from higher address to lower address. It may be a bad question, but I didn't get the concept right. Can you explain?
Jestin Joy
  • 3,711
  • 4
  • 19
  • 14
54
votes
4 answers

How does multi-level page table save memory space?

I am trying to understand how multi-level page table saves memory. As per my understanding, Multi-level page table in total consumes more memory than single-level page table. Example : Consider a memory system with page size 64KB and 32-bit…
Anil Kumar K K
  • 1,395
  • 1
  • 16
  • 27
53
votes
2 answers

Does every process have its own page table?

Does every process have its own page table or does it simply add it's page entries into one big page table?
48
votes
2 answers

Understanding Virtual Address, Virtual Memory and Paging

I've been learning these topics and read many articles and books but they all lack some complementary information and confused me even more. So here, I’d like to explain what I know while I am asking my questions. Hopefully, this topic will be…
Tarik
  • 79,711
  • 83
  • 236
  • 349
47
votes
6 answers

Why is the page size of Linux (x86) 4 KB, how is that calculated?

The default memory page size of the Linux kernel on x86 architecture was 4 KB, I wonder how was that calculated, and why ?
daisy
  • 22,498
  • 29
  • 129
  • 265
43
votes
2 answers

Allocating copy on write memory within a process

I have a memory segment which was obtained via mmap with MAP_ANONYMOUS. How can I allocate a second memory segment of the same size which references the first one and make both copy-on write in Linux (Working Linux 2.6.36 at the moment)? I want to…
Sergey L.
  • 21,822
  • 5
  • 49
  • 75
40
votes
2 answers

What exactly do shadow page tables (for VMMs) do?

My understanding is that shadow page tables eliminate the need to emulate physical memory inside of the VM. ie. Instead of: guest OS -> VMM + virtual physical memory -> host OS -> host hardware It's just: guest OS -> VMM -> host OS -> host…
aerain
  • 1,149
  • 3
  • 12
  • 17
40
votes
9 answers

Difference between physical/logical/virtual memory address

I am a little confused about the terms physical/logical/virtual addresses in an Operating System(I use Linux- open SUSE) Here is what I understand: Physical Address- When the processor is in system mode, the address used by the processor is…
gst
  • 1,251
  • 1
  • 14
  • 32
1
2 3
79 80