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
1answer
47 views

Is turning off swap a good idea when a system has available RAM and swap being used?

I have a system with 4 gigs of RAM and an SSD. I heard allocating swap on SSD is a bad idea because SSD has got limited write cycle. So when I see < 100 MiB of pages is written to the swap, and I ...
1
vote
0answers
19 views

Difference virtual address space and process address space?

Is there a difference in the definition of a virtual address space and process address space or can they be used as synonyms? Sometimes it seems, that process address space means only the memory that ...
1
vote
0answers
11 views

Why /proc/status and /proc/smaps RSS value is different?

If I sum up all Rss fields in /proc/smaps I never get the same result as VmRss field in /proc/status Who knows why this happens? Which value is true RSS? Example: cat /proc/16004/smaps | grep -P '...
0
votes
1answer
37 views

Disable buff/cache linux for fixing ubuntu hangs on full ram

I have 8 gb of ram, ssd and very greedy for ram Android studio/gradle. and sometimes when gradle builds project(eats ram) it hangs all ubuntu(and xubuntu). ui becomes so laggish - mouse cursor moves 1 ...
2
votes
1answer
31 views

What is the size of the x86_64 linux kernel page?

I am curious what is the size of the x86_64 linux kernel page. I heard that it is 4KB but some other sources tell it is 2MB. I am also curious if the user kernel page size can be different from the ...
4
votes
2answers
164 views

Solaris 10: Virtual Memory Exhausted

Our group is all programmers and exclusively use Linux or MacOS, but a customer uses Solaris 10, and we need our code to work there. So we scrounged up an old SunFire V240, and a rented Solaris 10 VM ...
0
votes
1answer
34 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
14 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
138 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
31 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
45 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
72 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
55 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
77 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 ...
1
vote
0answers
26 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
179 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
33 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
112 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
125 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
1k 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
205 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
90 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
285 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
41 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
153 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
78 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
461 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
365 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 ...
0
votes
2answers
621 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
1k 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
2k 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. ...
1
vote
0answers
27 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
50 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
19 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
434 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
236 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
177 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
3k 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
517 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
776 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
88 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
773 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
55 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
662 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
356 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
101 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, ...