Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [virtual-memory]

The tag has no usage guidance.

1
vote
2answers
32 views

Get the SuperPage size

It appears that some BSD systems have a superpage size of 2MB while others have 4MB. I've not seen any others. Is there any way to tell what the available superpage size is? Ideally from the command ...
0
votes
0answers
9 views

How guarantee a responsive Desktop using cgroup memory limit

I would like to setup a system with limited memory (raspberry pi) in such a way that application can't cause the desktop (x11, LXDE, openbox, mouse driver, video card driver) to be unresponsive. When ...
-1
votes
0answers
12 views

How guarantee a responsive Desktop using cgroup memory limit

I would like to setup a system with limited memory (raspberry pi) in such a way that application can't cause the desktop (x11, LXDE, openbox, mouse driver, video card driver) to be unresponsive. When ...
1
vote
1answer
38 views

How does the operating system read the page size from hardware?

Books on operating systems usually mentions that the page size is decided by the processor architecture, for example Intel x86 supports 4KB page size. I have a perception that when we were installing ...
2
votes
0answers
25 views

Share aarch64 page tables created by Linux with SMMU [closed]

I am currently working on creating a shared virtual address space in Linux arm64 on a Xilinx Zynq Ultrascale+ board. In the future it should be possible to share pointers/addresses between the Cortex ...
2
votes
0answers
73 views

Are .text sections shared between loaded ELF executables?

If one program, for example grep, is curretly running, and a user executes another instance, do the two instances share the read-only .text sections between them to save memory? Would the sharing of ...
2
votes
0answers
43 views

Is there a standard for the Linux user-space memory map?

I'm contemplating a project where I would use a memory mapped file that is shared between multiple processes, and in order to be able to use pointer values in the mapped region in all those processes*,...
1
vote
1answer
175 views

Where is page table stored in Linux?

I want know where Linux stores page tables. Is it in kernel virtual memory? It seems like this has to do with virtual memory system. but I'm new to it, so if I'm in the wrong direction please let me ...
0
votes
2answers
101 views

Is there a way to predict or count the number of page faults?

I am working on hardware performance counter (HPCs) and I seek to use these counters to measure some events accurately. I have found that the non-determinism in hardware performance counter (...
3
votes
0answers
67 views

What does nr_vmscan_write track, in layman’s terms?

nr_vmscan_write is a metric that refers to writeback of dirty pages during a scan of the LRU(s), I believe. As I understand it, there are only a few circumstances where this metric is incremented (in ...
1
vote
1answer
148 views

Swappiness set at 100, but is empty nonetheless

Backstory: So, I have a vm running and managed to open enough browser tabs to make linux mint freeze completely, by filling up both swap and ram. Then swappiness was at 60. So after this happened a ...
1
vote
0answers
31 views

How to force the kernel to always maintain at least some page cache?

Is there any way to force the kernel to always maintain at least some page cache for writeback caching purposes, even when faced with memory pressure? I have a rather special use case, where swapping ...
0
votes
1answer
28 views

Why are “program images and shared libraries” “considered private to a process” but “shared (SHR) by the kernel”?

In the manpage of top, Why are "program images and shared libraries" in #3 "considered private to a process", if "they will be accounted for as shared (SHR) by the kernel"? In what "private" sense ...
0
votes
1answer
59 views

What is the difference between USED and VIRT?

In the manpage of top, What is the difference between USED and VIRT? USED is "RES" + "SWAP". Is "VIRT - USED" equal to pages that have been mapped but not used? Does "VIRT" or "USED" include the ...
1
vote
1answer
55 views

Will starting a virtual machine created by virtualbox immediately reserve physical RAM assigned to it?

When creating a virtual machine and then installing Android or Windows or other OS on top of it, if I assign 4GB to the virtual machine, will starting the virtual machine immediately reserve 4GB ...
0
votes
1answer
127 views

Do threads of a process work in the same virtual memory space in linux?

So i was reading this question : https://stackoverflow.com/questions/1762418/what-resources-are-shared-between-threads and based on the answer, "threads share all segments except the stack, but a ...
1
vote
1answer
225 views

Does the Linux kernel have its own page table?

Different processes have different different page tables for their address spaces. Does the Linux kernel have its own page table? If not, how are the virtual addresses of kernel translated to ...
-1
votes
2answers
191 views

Is copy-on-write not implemented based on page fault?

Operating System Concepts say fork() we can use a technique known as copy-on-write, which works by allowing the parent and child processes initially to share the same pages. ... When it is ...
3
votes
2answers
482 views

Are sharing a memory-mapped file and sharing a memory region implemented based on each other?

Are sharing a memory-mapped file and sharing a memory region implemented based on each other? The following two quotes seem to say so, and seem a chicken-egg problem to me. Operating System Concepts ...
3
votes
2answers
584 views

How does memory mapping a file have significant performance increases over the standard I/O system calls?

Operating System Concepts says Consider a sequential read of a file on disk using the standard system calls open(), read(), and write(). Each file access requires a system call and disk access. ...
0
votes
0answers
23 views

Does page replacement always happen together with page fault?

If a page fault happens, and no free page is available, then page replacement happens. Is it the only case when page replacement happens? Does page replacement happen without page fault ...
2
votes
1answer
43 views

Does a pager move or copy a page when handling a page fault?

When a process accesses a page not in the main memory but in the swap space, a page fault happens, and the pager reads a page from swap space to main memory. Is the read a move or copy? In other ...
0
votes
1answer
17 views

when a process is not running, can some pages used by the process and not shared with other running processes remain in the main memory?

When a process is changing its status from running to nonrunning (ready, waiting,...), either by itself or by scheduler, are all the pages used by the process and not shared with other running ...
0
votes
1answer
218 views

How many page faults does this program need?

Operating System Concepts says Let’s look at a contrived but informative example. Assume that pages are 128 words in size. Consider a C program whose function is to initialize to 0 each element ...
3
votes
1answer
112 views

Why some libraries and other parts get repeated in the linux virtual memory with gdb?

This is the result of looking at virtual memory of a process in gdb; I have some questions regarding this: Why are some parts of the virtual memory are repeated? For example, our program (stack6) and ...
2
votes
2answers
128 views

When do we jump into kernel part of our process virtual memory other than when we use system calls? (In Linux)

This is a follow up question from my previous question. Based on the answer, a system call is an example of when we jump into kernel part of virtual memory of our process. What are other examples ...
3
votes
1answer
1k views

What exactly happens in virtual memory when I call a function like printf in Linux? [closed]

I'm asking about functions like printf that a lot of processes might use and also need the help of kernel for stuff like system calls. What is the step-by-step description in detail for what happens? ...
8
votes
2answers
2k views

Why on modern Linux, the default stack size is so huge - 8MB (even 10 on some distributions)

For example, on OSX, it's even less than 512k. Is there any recommended size, having in mind, that the app does not use recursion and does not allocate a lot of stack variables? I know the question ...
1
vote
2answers
215 views

Is the MMU inside of Unix/Linux kernel? or just in a hardware device with its own memory?

So i always thought MMU is part of the unix kernel that translates addresses to physical addresses but in the MMU wiki page it says its a computer hardware that usually have its own memory, but that ...
0
votes
2answers
300 views

Retrieving virtual memory size (VSZ) value of a single process

I would like to get VSZ value of a specific process running on Linux server The following command: ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( ...
23
votes
5answers
4k views

Does Linux not use segmentation but only paging?

The Linux Programming Interface shows the layout of a virtual address space of a process. Is each region in the diagram a segment? From Understanding The Linux Kernel, is it correct that the ...
0
votes
1answer
59 views

Do page fault, page replacement, and paging happen to the kernel or just to processes, and to the kernel space or the user space?

Do page fault, page replacement, and paging happen to the kernel or processes, and the kernel space or the user space?
5
votes
1answer
394 views

Do the virtual address spaces of all the processes have the same content in their “Kernel” parts?

The Linux Programming Interface shows the layout of a virtual address space of a process: Is the kernel in the physical memory completely or partially mapped to the part "Kernel" on the top from ...
0
votes
1answer
37 views

Does the isolation between virtual memory address spaces of different processes not apply to privileged process and to swap?

From The Linux Programming Interface The virtual memory page containing the data may be swapped out (unless it is locked in memory using mlock() or similar), and could then be read from the ...
0
votes
1answer
406 views

Do memory mapping segment and heap grow until they meet each other?

I try to figure out the range of the shared memory segment i.e. the memory mapping segment in the memory layout of a process, from two sources below. From https://manybutfinite.com/post/anatomy-of-a-...
1
vote
1answer
193 views

Where are “the kernel stack”, “Frames for C run-time startup functions”, and “Frame for main()” in the memory layout of a program?

From The Linux Programming Interface: Where is the kernel stack (mentioned in the quote below) in the above diagram? Is it the top part "Kernel (mapped into process virtual memory, but no ...
0
votes
0answers
68 views

AIX used memory gets never free

In an virtualized AIX 7.1 system when it's restarted the overall physical memory is listed as free (by all AIX stats tools). But after some hours running some applications the used memory increases, ...
1
vote
3answers
150 views

How much swap space does Solaris 11.3 need to run a compiler?

I have a desktop with a Core i5 3rd gen and 4 GB of RAM. I am using the machine to test building some free software projects I contribute to. The machine serves no other purpose. I allocated 4 GB ...
1
vote
2answers
271 views

Can't create a swapfile for Solaris 11.3

My compiles are failing on Solaris 11.3 due to out of memory kills. The box is an UltraSPARC workstation with 600GB drives and 8 GB of RAM and a fresh OS install. It is absolutely befuddling there's ...
1
vote
3answers
125 views

Linux Kernel memory management quote

I'm having an incredibly tough time making sense of this excerpt from the Linux device drivers book (sorry for text-heavy post): The kernel (on the x86 architecture, in the default configuration) ...
0
votes
2answers
340 views

Understanding Memory Maps

Memory maps allow pages to be "faded in" across multiple processes so that multiple processes can access them. Explain how the operating system can handle this with paging?
-1
votes
1answer
39 views

Risk of keep mysql data folder into linux cache

Is there a risk of doing: vmtouch -dl /mysql-data-folder On a production server with 192GB RAM and mysql data folder of 50GB. What is vmtouch? man vmtouch vmtouch opens every file provided ...
0
votes
0answers
16 views

Formula that relates virtual, physical, resident, non-resident (swap) memory?

Is there some mathematical or conceptual formula that relates these different forms of memory? I know that virtual memory is the largest of them all, and is made up of all the other types of memory. ...
2
votes
3answers
81 views

Swap memory, and when the OS starts using it

We are running Red Hat Enterprise Linux version 7, and all our machines are virtual machines. Our memory resources are limited and physical RAM costs money so we are thinking of increasing swap ...
1
vote
2answers
319 views

What is the difference between paging and context switching? [closed]

It seems like both involves swapping processes in and out. In paging, you swap out a page of an existing process and replace it with another page from disk (virtual memory I believe), but for ...
2
votes
2answers
168 views

What is Address Binding?

I have found some explanations about what "address binding" is. They say that "address binding is an operation of mapping virtual or logical addresses to physical addresses." Is this definition ...
0
votes
2answers
349 views

Physical Address of a variable in processes

When we create a child process by using the system call fork(), address space of parent process is copied to child process. The code below demonstrates this clearly. #include <stdio.h> #include ...
0
votes
0answers
18 views

Process memory usage right before executing of its first instruction

How can I get the size of a process right before its execution without executing the program with any particular input? I was thinking maybe a debugger can do so. I have IDA pro if that helps.
0
votes
1answer
126 views

Question about RAM and SWAP on Windows Host OS

i've read and appreciated the original post by Thompsonn. At work i'm forced to use Windows as the host OS (I work with and prefer Linux) because of the mandatory requirements in certain applications ...
20
votes
1answer
491 views

Is this how linux paging should behave? (because it seems awful…)

When my linux system gets close to paging (i.e., in my case, 16GB ram almost full, 16GB swap completely empty) if a new process X tries to allocate some memory the system completely locks. That is, ...