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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [virtual-memory]

The tag has no usage guidance.

0
votes
1answer
21 views

Does the kernel address region in user page tables need to be updated in an 64 bit system?

In 32 bit systems with more than 896 MB of RAM it is obvious, that the mapping of kernel addresses need to be changed because of kernel virtual addresses and the non-continuous mapping. But how is ...
0
votes
0answers
10 views

Find applications accessing certain memory address / trace memory access

Is there some way on Linux or Unix systems to determine if a distinct physical or virtual memory address has been accessed? I know the address or list of addresses but want to know if and what ...
1
vote
2answers
85 views

What's inside the kernel part of virtual memory of 64 bit linux processes?

I came upon this question : What's the use of having a kernel part in the virtual memory space of Linux processes? and based on the answer and the comments on the answer : the kernel memory ...
0
votes
0answers
28 views

What is the benefit of a per-process memory limit given demand paging?

There are several questions on here regarding how to set a limit on a process's memory consumption. I have recently learned about demand paging, and my question is why it would be useful to set such a ...
0
votes
1answer
39 views

uninitialized pointers dangerous?

I read, that pointers (in C), that are not initialized, could point to an address that contain data or program code from other programs. In the book it says, that this can cause damage. Is this issue ...
0
votes
1answer
46 views

How to understand PBS output “mem” and “vmem” keep the same when the task is x-fold increased with mpirun -np x task

Here is a simple experiment I tried: Given a task called "sim.exe" which doing a model simulation, I then use MPI to launch x "sim.exe" simultaneously on one node (shared memory system). I have tried ...
2
votes
1answer
23 views

Kernel Logical address

Does Kernel logical address go through MMU when used in load/store instruction? Does MMU handle kernel logical address differently from kernel virtual address? Please give reasons for the same. If ...
1
vote
0answers
15 views

Using Systemtap probing Getting the virtual address location of bytes for every read write operation in Linux

Using Systemtap probing tool I got the way to get total amount of bytes read by a file by probing syscall.read and syscall.read.return function. syscall.read.return has returnval() which gives the ...
1
vote
2answers
53 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
15 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
99 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
29 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
85 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
86 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
531 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
164 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
83 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 ...
2
votes
0answers
220 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
34 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
32 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
107 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
71 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
295 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
2answers
307 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
396 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
921 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
1k 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
24 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
48 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
18 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
348 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 ...
4
votes
1answer
173 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
156 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
339 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
502 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
5k 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
71 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?
6
votes
1answer
548 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
46 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
541 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
288 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
83 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
183 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
349 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
174 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
373 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
44 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
19 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. ...