mmap Questions
1
I'm trying to understand some of shared_memory's operation.
Looking at the source , it looks like the module uses shm_open() for UNIX environments, and CreateFileMapping \ OpenFileMapping on wind...
Footlight asked 3/7, 2019 at 20:39
1
Solved
I'm running some experiments with stack and the following got me stuck.
It can be seen that Linux has initial [stack] mapping 132KiB in size. In case of ulimit -s unlimited we can expand the stack...
1
I'm trying to understand how stack works in Linux. I read AMD64 ABI sections about stack and process initialization and it is not clear how the stack should be mapped. Here is the relevant quote (3...
Farewell asked 4/7, 2019 at 19:21
1
Solved
I read that RawArray can be shared between proceses without being copied, and wanted to understand how it is possible in Python.
I saw in sharedctypes.py, that a RawArray is constructed from a Buf...
Trinidad asked 7/6, 2019 at 13:41
1
In Linux, using C, if I ask for a large amount of memory via malloc or a similar dynamic allocation mechanism, it is likely that most of the pages backing the returned region won't actually be mapp...
Kumamoto asked 1/6, 2019 at 23:33
2
Solved
I have a program which performs some operations on a lot of files (> 10 000). It spawns N worker threads and each thread mmaps some file, does some work and munmaps it.
The problem I am facing rig...
Essary asked 3/5, 2019 at 7:51
1
Solved
I'm trying to load a statically linked program from another one and execute it. My steps are:
Parse the ELF
Parse the segments from the program headers
For each PT_LOAD
Load it
Jump to the starti...
3
Solved
I think I have the opposite problem as described here. I have one process writing data to a log, and I want a second process to read it, but I don't want the 2nd process to be able to modify the co...
3
I found many errors like this one
[Wed Nov 06 14:34:01 2013] [warn-phpd] mmap cache can't open C:\www\somefile.php (pid 4484 th 1668)
in my Apache error.log file. I tried to pinpoint the source ...
3
Solved
c code:
// program break mechanism
// TLPI exercise 7-1
#include <stdio.h>
#include <stdlib.h>
void program_break_test() {
printf("%10p\n", sbrk(0));
char *bl = malloc(1024 * 1024...
Illuviation asked 30/5, 2015 at 4:56
3
My php-fpm process is facing performance issues on Ubuntu 14.04 LTS (Nginx server, MariaDB database).
strace -f $(pidof php-fpm7.1 | sed 's/\([0-9]*\)/\-p \1/g')
Gave me
<... epoll_wait res...
Calvaria asked 10/7, 2017 at 13:42
2
I am trying valgrind for detecting memory leak. It works well on heap leak(i.e. memory allocation from malloc or new). however, does it support check mmap leaking in linux?
Thanks
Chang
Luke asked 11/3, 2013 at 8:37
1
Solved
I have a file foo.txt with the content
foobar
I want to continuously append to this file and have access to the modified file.
MmapMut
The first thing I tried is to mutate the mmap directly:
...
2
Solved
I’m storing some data in a shared memory array used by several processes. At some point I want to grow the array.
Assume there’s already a synchronisation mechanism between the processes
Initial...
Botti asked 13/3, 2018 at 21:33
1
I have an application that sequentially reads data from a file. Some is read directly from a pointer to the mmaped file and other parts are memcpyed from the file to another buffer. I noticed poor ...
Annikaanniken asked 16/10, 2018 at 23:41
3
I try to run a simple test of mmap under MacOSX 10.8.2, with XCode 4.6. This program is as follows, the file mapped for read is OK while the access to the write pointer "target" will make the progr...
0
I'd like add the number of mapped memory regions to the status report of my daemon.
There's a number of reasons why you may want this:
There's a limit for that (vm.max_map_count) so it's good t...
2
Solved
I'm currently working on some code that shares some state between processes using a mmap object. The use case is a bunch of processes that have access to some read-only data in a shared mmap backed...
Catabasis asked 28/11, 2015 at 22:52
2
I'm writing some software to deal with pretty critical data, and need to know what exactly I need to do to achieve durability.
Everywhere I look is contradictory information, so I'd appreciate any...
Rhythmics asked 20/10, 2012 at 15:59
3
Solved
I have relatively new to C++ and I am learning from another guy's code.
His code reads from a mmapped file, but does not free any mapped memory in the end. In my understanding, mmap() map files in...
Enrich asked 26/10, 2014 at 2:26
1
I'm using Realm 2.4.3 in a large iPad Application for one of our customer.
Most of the time Realm performed very well, but now the number of Records is increasing and a get some memory issues.
App...
Haematoxylin asked 1/3, 2017 at 9:23
3
Solved
I ran the program with root priviledge but it keeps complaining that mmap cannot allocate memory. Code snippet is below:
#define PROTECTION (PROT_READ | PROT_WRITE)
#define LENGTH (4*1024)
#ifnde...
3
We're experimenting with changing SQLite, an embedded database system,
to use mmap() instead of the usual read() and write() calls to access
the database file on disk. Using a single large mapping ...
5
I have implemented by own malloc and free using mmap. Now since unlike free, munmap also takes length as parameter, therefore I put length as an additional information in the mapped memory.
The cod...
Recommend asked 12/12, 2011 at 14:12
1
Solved
I need to allocate large blocks of memory (to be used by my custom allocator) that fall within the first 32GB of virtual address space.
I imagine that if I needed, say, 1MB blocks, I could iterate...
Rox asked 19/5, 2018 at 20:48
© 2022 - 2024 — McMap. All rights reserved.