Questions tagged [mmap]

All about using memory mapped files. Questions on programming should be asked on Stack Overflow SE.

11 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
1answer
571 views

OOM from iterating over very large memory map

I'm writing a simulator that relies on generating a (potentially) very large problem domain. As the data can't fit in RAM, I use 4 four memory mapped files to hold it. This is a 64-bit application ...
3
votes
0answers
530 views

Using shared memory through tmpfs and NUMA on x86_64/Linux

Here's what I'd like to do: put a file on tmpfs but ensure that all of it (all pages of it) ends up on the same NUMA node. First, I thought this would be trivial: I'd just mmap() a tmpfs file with ...
2
votes
0answers
175 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*,...
2
votes
0answers
242 views

How to find part of the code which creates Anonymous private memory mapped region

I'm analyzing /proc/pid/smaps output for C++ process and I find large number of private memory mapped regions. Number of memory mapped regions keep growing based on the traffic. Is there a way I can ...
1
vote
0answers
60 views

Weird major page fault number when reading sequentially / randomly in mmap region

I'm following this answer, trying to generate some major page faults with mmap: #include <fcntl.h> #include <stdio.h> #include <sys/mman.h> #include <sys/stat.h> int main(...
1
vote
0answers
202 views

journalctl's mmap() calls make it incredibly slow

Whenever I run journalctl, it runs astonishingly slowly. It often takes minutes or even hours to return results. I've experienced some other performance problems on the affected machine that seemed to ...
1
vote
0answers
56 views

The same program which uses 'mmap' behaves differently on the different machines

I am running an application which uses a huge memory mapped file on two different machines (CentOS 7). I found that the same program's performance is significantly different when it's running on two ...
1
vote
0answers
159 views

Pagemap on memory mapped devices not working

I am trying to find the physical addresses of heap variables, stack variables and memory mapped peripheral addresses using the /proc/{pid}/pagemap file using the steps detailed in the file: http://lxr....
1
vote
1answer
45 views

How do I create a temporary file in memory?

I need to create some (small) temporary files in my zsh scripts, and I want them to live on RAM so as to avoid disk IO. What are the idiomatic ways of doing this? I want it to work on Linux and macOS, ...
0
votes
0answers
34 views

Is a mmaped file considered an open file in linux/unix?

Hi I feel confused about open file and mmapped file. I know that if a file is accessed using system call such as read/write will return a file descriptor, and be considered as an open file? How about ...
0
votes
1answer
195 views

Does a forked process copy all mapped memory when writing?

I understand that a forked process maps the parent's memory and copies it when writing to it. Does it copy just what it needs written or does it copy the entire mapped memory ?