Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [memory-management]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

What is the contribution of API to the memory usage of a process in linux as shown by pmap command?

I am trying to understand the memory usage of my program excluding the contribution of custom made API that creates and attaches to shared memory segment. Following is the API code. I have included ...
Soumajit's user avatar
  • 101
0 votes
0 answers
15 views

Memblock, e820 table and struct resources, are they all needed?

I find the early linux physical memory management to be overcomplicated. There are three main components to it: there is the e820 table for storing memory areas as reported by the bios, there is ...
caciquekampeon's user avatar
1 vote
1 answer
28 views

Understanding memory limits in a systemd service: Are they per-process or combined?

I have a systemd service named vcoagent.service running on my Linux system, and I'm trying to understand how memory limits specified for the service (Memory: 300.3M (limit: 500.0M)) apply to the ...
Ackerman Shadow's user avatar
0 votes
0 answers
25 views

Is it possible to read page table in Linux with unprivileged mode?

this is my very first question in Unix & Linux, I'm currently learning about virtual memory. I am appreciating this awesome paper drammer (CCS'16). Where it fools the buddy allocator to allocate a ...
Y.H.Qian's user avatar
1 vote
0 answers
154 views

Process memory layout - difference between heap, data and mmap areas

I see in the web many conflicting or unclear descriptions of the memory layout of a Linux process. Usually the common diagram looks like: And a common description would say that: The data segment ...
aviro's user avatar
  • 5,622
0 votes
0 answers
44 views

Resident memory size RES automatically decreased after 10-day aging

My application consists of multiple processes. Each of the processes has multiple threads. Heap memory areas are allocated and freed dynamically during the operation. I had a memory leaking bug in the ...
Masaki Nishikawa's user avatar
4 votes
1 answer
3k views

Is there a way to set a hard cap/limit on how much RAM Chrome can use?

I'm using Linux on my Steam Deck (SteamOS/Arch Linux). Is there a method to set a hard cap/limit on the maximum total RAM Chrome can use with command line arguments? (to 8 GB out of the device's max ...
JLHack7's user avatar
  • 41
0 votes
1 answer
62 views

Memory total shown on Linux on 8GB memory PC is only 7038920 kB

Why linux /proc/meminfo show:" 1 MemTotal: 7038920 kB " (proc most likely is to mean Kibibyte) in a PC of 8 GB memory RAM, although its Kibibyte is 7812500 ?
user avatar
0 votes
1 answer
75 views

Do page tables used to store kernel stack pointer when context switch happen in kernel mode of the process?

I have two questions; Suppose a user space application/process is running in kernel mode. I understand if a context switch is happened now, the kernel stack pointer of that process is stored in the ...
Franc's user avatar
  • 289
4 votes
1 answer
2k views

How does mmio get routed to io devices?

I am trying to understand how IO devices are mapped into the 'regular' memory address space on modern x86 machines running Linux. Some details which I am trying to make sense of are: cat /proc/iomem ...
shafe's user avatar
  • 201
1 vote
1 answer
203 views

On some UNIX implementations, it is not possible to call free() on a block of memory allocated via memalign()

I use Linux only but I want to understand what this means: From the Linux Programming Interface: Blocks of memory allocated using memalign() or posix_memalign() should be deallocated with free(). On ...
Rick's user avatar
  • 1,157
3 votes
1 answer
1k views

Can a Linux Swap Partition Be Too Big?

Can a Linux swap partition be too big? I'm pretty certain the answer is, "no" but I haven't found any resources on-point, so thought I'd ask. In contrast, the main Windows swap file, ...
ebsf's user avatar
  • 321
0 votes
0 answers
189 views

How can i access the page table of a process from kernel using a custom syscall?

I am using Ubuntu 16.04, kernel: 4.17.4 I want to access the page table of a process. The idea is, inside a c code I will call a custom Syscall and the syscall will be able to access the page table of ...
Misbah's user avatar
  • 1
0 votes
1 answer
148 views

Is vmalloc() allocate bytes of memory which is virtually contiguous maps to memory area from different physical pages?

vmalloc(size) allocates a memory of size long which is virtually contiguous but the physical mapping would not be contiguous. Does that mean the the virtually allocated size long memory actually lies ...
Franc's user avatar
  • 289
2 votes
0 answers
123 views

How can I keep file-backed executable pages evicted from RAM in Linux?

I tried using madvise(MADV_DONTNEED) and verified with /proc/pid/pagemap that pages are unmapped correctly. Although none of the functions in the page is accessed, some of the pages are mapped back ...
pcp's user avatar
  • 21
1 vote
1 answer
240 views

what does fix mean in VMA operation in virtual memory managment

I'm reading "Understanding the Linux Virtual Memory Manager" by Gorman. In Chapter 4 about Process Address Space, when VMA operations are introduced, for example create, lock and unlock, the ...
Zzzz's user avatar
  • 13
0 votes
1 answer
425 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
1 vote
1 answer
164 views

Why x86 ISA devices cannot perform DMA in to the full 32 bit address space?

As per Robert Love 's Linux Kernel Development , an x86 ISA device cannot perform DMA in to the full 32 bit address space because ISA devices can access only the first 16MB of physical memory(range ...
Franc's user avatar
  • 289
0 votes
2 answers
288 views

Virtual Address Space [closed]

I have started to learn about Virtual Address Space (VAS) and I have few questions: How much of VAS is created for each process depending on the architecture (32-bit and 64-bit)? Is VAS for each ...
Vivek's user avatar
  • 101
0 votes
1 answer
2k views

How do I delete shared memory that was used by mounted tmpfs directory?

I executed this command to create a RAM-Disk: mount -t tmpfs -o size=60G tmpfs /tmp/ramdisk After that I copied several files into this virtual filesystem as follows: cp /mnt/user/hugefile.bin /tmp/...
mgutt's user avatar
  • 487
0 votes
1 answer
408 views

Page table content when the physical page we are looking for is in swap area

If this question depends on the linux distribution, please answer it in a "general way" (i.e. the most common implementation on linux distributions). In the page table of a process we can ...
isma's user avatar
  • 5
1 vote
1 answer
2k views

Size of virtual memory in Linux

On what basis the size of User and kernel virtual memory is decided in Linux? (32-bit, if that's relevant.) Is it configurable? If we have 512 MB RAM What will be the size of user and kernel virtual ...
Krishnamoorthi M's user avatar
2 votes
1 answer
2k views

How does the paging concept work with heap and stack memory?

Does the process pre-allocate heap and stack memory while dividing it into pages? If yes, will all those pages be empty initially?
Karthik Nedunchezhiyan's user avatar
0 votes
0 answers
228 views

private memory for specific processes

(assuming root account is not involved in this matter;) is it possible for two processes to share a piece of memory that only they can access? the best i can think of is to create a dedicated user ...
Cyker's user avatar
  • 4,314
3 votes
1 answer
685 views

How does Linux translate a physical address to (possibly multiple) virtual address?

From my understanding, when Linux swaps a physical page frame in/out RAM, it needs to set valid bit for all virtual pages mapping into this physical page. Mapping a virtual page to physical page frame ...
Eric Stdlib's user avatar
2 votes
2 answers
396 views

What is "BSD-style memory management"?

I'm running Arch Linux. In /usr/include/sys/mman.h, it says: /* Definitions for BSD-style memory management. Copyright (C) 1994-2019 Free Software Foundation, Inc. . . . What does this mean? What ...
extremeaxe5's user avatar
  • 1,183
1 vote
0 answers
320 views

memory swapping and cgroup

I wonder how is swapping mechanism implemented under the memory cgroup v1. Most existing books (understanding the linux kernel, professional linux kernel architecture, understanding the linux virtual ...
yuanqili's user avatar
  • 111
0 votes
1 answer
1k 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 ...
pudi's user avatar
  • 65
1 vote
0 answers
142 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 ...
uLoop's user avatar
  • 141
0 votes
1 answer
1k views

How to Increase RAM usage without increasing Cache.?

Amount of memory utilized in RAM is getting stored in Cache . Is there any way to manually increase RAM usage without increasing cache. Below the sample where increasing RAM is also increasing cache. ...
Shahid Hussain's user avatar
2 votes
2 answers
1k 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 ...
Goktug's user avatar
  • 611
12 votes
2 answers
2k views

What's the lifespan of a file descriptor?

As described here, redirections use open() to write to a file. There's an inner (?) file descriptor created in the shell, and then used when needed. Is the inner descriptor created for the whole ...
user avatar
0 votes
3 answers
1k views

What happens if a Linux distro is installed with no swap and when it’s almost out of RAM executes a new application? [duplicate]

What happens if a Linux, let’s say Arch Linux or Debian, is installed with no swap partition or swap file. Then, when running the OS while almost out of RAM, the user opens a new application. ...
eye's user avatar
  • 3
2 votes
0 answers
236 views

How to check whether physical page is in-use?

I am implementing kernel thread which scans whole physical pages in memory and inspect physical page frame numbers of in-used pages. At first, I thought I can check whether specific page is used by ...
JuHyung Son's user avatar
2 votes
1 answer
4k views

Kernel address space and Kernel page table

I am studying Professional Linux Kernel Architecture and I am in Chapter 3 Memory Management. While I studied kernel address space itself is split into direct mapping area, vmalloc area, kmap area and ...
JuHyung Son's user avatar
2 votes
1 answer
238 views

How does Qubes do memory management, especially with regard to shared objects?

I'm just reading about Qubes OS, and I have a very simple question -- how does it do memory management and shared object use? Feel free to correct any misconceptions or errs in vocab, but we have the ...
Evan Carroll's user avatar
  • 31.2k
10 votes
2 answers
3k views

Why read-only memory mapped regions have dirty pages?

Executing (for example) the following command to get the list of memory mapped pages: pmap -x `pidof bash` I got this output: Why some read-only pages are marked as "dirty", i.e. written that ...
ocirocir's user avatar
  • 263
4 votes
1 answer
2k views

How does the kernel address swapped memory pages on swap partition or swap file?

A swap partition doesn't contain a structured filesystem. The kernel doesn't need that because it stores memory pages on the partition marked as a swap area. Since there could be several memory pages ...
direprobs's user avatar
  • 974
2 votes
0 answers
68 views

How to handle exceptional page when allocating contiguous cache pages in Linux

I have a kernel module code which allocates contiguous cache pages. I use radix_tree_for_each_contig(). Here is the partial snippet of the code. radix_tree_for_each_contig(slot, tree_root, iter, ...
stev's user avatar
  • 21
7 votes
1 answer
473 views

How is the page cache mapped in the kernel on 64-bit x86 architectures?

On a modern 64-bit x86 Linux, how is the mapping between virtual and physical pages set up, kernel side? On the user side, you can mmap in pages from the page cache, and this will map 4K pages in ...
BeeOnRope's user avatar
  • 559
1 vote
0 answers
46 views

is there difference between running an application from nand and ramdisk?

I'm using an application on an embedded linux platform. I copied this application to a nand device with a jffs2 filesystem and ran it from there and system performance is significantly degraded. I ...
mhk's user avatar
  • 145
1 vote
1 answer
176 views

Determing if an embedded Linux system runs uClinux

I have an ARM Linux system running kernel version 2.4, but I'm not sure if the processor has a memory-management unit, so how can I tell whether the system is running a uClinux kernel or a vanilla ...
Billy's user avatar
  • 665
0 votes
1 answer
717 views

Redhat: Swap Memory Used is Much Higher Than Total

The top command showed the following information: Mem: 132110132k total, 10447536k used, 121662596k free, 76120k buffers Swap: 16777212k total, 18446744063504593392k used, 10221735436k free, ...
Pau Z Wu's user avatar
  • 101
4 votes
1 answer
2k views

Creation of the heap region/segment in Linux

It's my understanding that on Linux the process loader doesn't automatically create a "heap" region for a process like it's the case for the stack, is that correct? I used /proc/$$/maps and before ...
othman's user avatar
  • 41
4 votes
1 answer
2k views

Why does my process take too long to die?

Basically I'm using Linux 2.6.34 on PowerPC (Freescale e500mc). I have a process (a kind of Virtual Machine that was developed in-house) that uses about 2.25 G of mlocked VM. When I kill it, I notice ...
Anirban Ghoshal's user avatar
3 votes
1 answer
2k views

How does the kernel decides what pages commit to swap?

If RAM usage is higher than the level written in «swapiness», kernel will use SWAP. Ok. But how does the kernel «order» programs? Is it «first come, first served» for RAM? Or biggest programs in ...
chindit's user avatar
  • 181
0 votes
1 answer
173 views

managing resources on a debian server

We have a debian server shared by all group members to run their memory/cpu (64GB RAM and 23 cores) intensive codes on it. The problem is sometime one code overload the whole server and no one else ...
Moj's user avatar
  • 101
1 vote
0 answers
400 views

GFP mask of 0x200da on a 64-bit system?

Recently, an OOM showed a GFP mask of 0x200da on a 64-bit system. How is that possible? 0xa would suggest we are talking about Movable Highmem, see: http://lxr.free-electrons.com/source/include/linux/...
Marki's user avatar
  • 855
1 vote
1 answer
683 views

USB flash drive file transfers seem to hang multiple times during file transfer

I've got Scientific Linux 6.4 Installed (RHEL6.4) and am having trouble transferring to and from USB flash drives... Transfer seems to hang multiple times during transfer to the device, and transfer ...
mogthesprog's user avatar
12 votes
1 answer
7k views

Zswap, Zram, Zcache desktop usage scenarios

I've been trying to understand the difference in use cases for Zswap, Zram, and Zcache. Apologies in advance for the long/slightly sloppily worded question. I've done a bunch of googling, and I ...
Warren's user avatar
  • 133