Questions tagged [shared-memory]
The shared-memory tag has no usage guidance.
71
questions
0
votes
1
answer
27
views
Can a process share unused memory with others?
I want to run about 200 processes with my experiments. Every of them really needs less than a GB:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24688 rinkman 20 0 ...
0
votes
1
answer
45
views
Shared memory using shmget()
According to my understanding about shared memory is that it is a memory segment that is shared between two or more processes. Shared memory can be implemented using shmget() . However , since any ...
0
votes
0
answers
100
views
Values from sysctl -A don't match /etc/sysctl.conf even after restart
I'm on Mac Monterey 12.1 and increased my shared memory limits in /etc/sysctl.conf file:
kern.sysv.shmmax: 16777216
kern.sysv.shmmin: 1
kern.sysv.shmmni: 128
kern.sysv.shmseg: 512
kern.sysv.shmall: ...
0
votes
0
answers
51
views
ipcrm won't delete some shared memory blocks
I have shared memory I am trying to delete using ipcrm on a Mac.
I managed to delete all segments except the below:
T ID KEY MODE OWNER GROUP
Shared Memory:
m 2359296 ...
0
votes
1
answer
296
views
How does a process and its children use memory in case of mmap()?
Let's say, we are creating a shared memory using mmap(). Let's say the total memory size is 4096. If we use a fork() system call to create children, would the children use the same memory, or will ...
0
votes
1
answer
86
views
When should I alter overcommit_memory and what should I take into consideration when doing so?
I'm having a PC freeze issue that I can't seem to figure out. I have three identical PCs. They are each custom builds with i7 and 64GB of RAM. The OS drives are 512GB nvme drives. They each run ...
0
votes
0
answers
20
views
Can't find cached and buffer from 'cat /proc/meminfo'
I want to find cached memory and buffer memory here. But unlike linux, bash does not give me all the information as expected. How can I find cached memory, shared memory and buffer memory?
I used the ...
0
votes
0
answers
35
views
shmat returns error (void *) -1 in selinux enabled rhel environment
as per the documentaion:-
If SHM_RDONLY is specified in shmflg, the segment is attached for reading and the process must have read permission for the segment. Otherwise the segment is attached for ...
0
votes
0
answers
44
views
Shared memory as reported by free not equal df reported one. Cache takes huge amount of memory despite recent drop_caches
I'm running Linux Mint 20. I often encounter low memory situations. Today I do not understand why available is so low. As per What is the meaning of `shared` memory in the `free` command? shared is ...
0
votes
0
answers
47
views
Selinux avc denied read write to shm key
I am new to selinux concept and I want httpd to access shared memory, but some how httpd is not able to access the shared memory, as per audit log the message tells read write is denied for shm class ...
2
votes
1
answer
78
views
Am I making invalid assumptions with regard to my kernel module's shared memory?
I have written a "device driver" (see source code here: https://bitbucket.org/wothke/websid/src/master/raspi/websid_module/ ) that runs fine for most of the time (see https://www.youtube.com/...
3
votes
0
answers
634
views
Shared memory usage is piling up
I'm using Ubuntu 20.04.2 LTS with kernel 5.4.0-70-generic. Shared memory keeps piling up until system hangs as it doesn't have any memory left.
I'm using Prometheus + Grafana to monitor my system ...
0
votes
1
answer
629
views
FFmpeg cannot write file to /dev/shm: Permission Denied
Issue:
I have an FFmpeg command that I've been running for months now to stream video into the /dev/shm directory. It had been working fine until relatively recently (e.g. within a week), now it ...
1
vote
1
answer
263
views
Delete POSIX shared memory owned by different user
I have a program that creates four shared memory objects. The memory creation routine calls shm_unlink() before attempting to create them, and the program calls another routine to delete them with ...
0
votes
1
answer
517
views
Do anonymous memory mapping and shared memory allocate space from physical memory only?
In Linux,
when using mmap() for anonymous memory mapping, or using malloc(), do they allocate "space" from only physical memory, or either physical memory or swap or their combination? (I ...
1
vote
0
answers
1k
views
How to disable X11 extension (MIT-SHM) for systemd-nspawn container?
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 130 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Value in ...
0
votes
0
answers
117
views
SIGBUS immediately after successful mremap for shared memory
I am using POSIX shared memory. Initially I map four shared memory buffers. One of them exceeds its allocated size so I call mremap:
void * remap_shm(void *old_address, size_t old_size, size_t ...
2
votes
1
answer
659
views
How to revoke write permissions on a shared memory object s.t. subsequent writes to aleady mapped pages by other processes will fail?
Is there any way to revoke write permissions to shared memory by the process who created that shared object, s.t. any other process who has mapped the shared memory to its virtual space with write ...
2
votes
1
answer
779
views
AMDGPU driver vramlimit
I have a console installation of debian and i found that from the available 16GB of ram i can see only 14GB, this is because my APU (AMD) is reserving 2GB which is way too much for my needs. The bad ...
0
votes
1
answer
643
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 ...
4
votes
1
answer
820
views
Will swap file engage automatically when I write too much to /dev/shm
Text analytics programming today. My program is going to write about 45 million small temporary files to /dev/shm and their size estimate is 177.0 GB. I'm going to delete them soon after the next ...
2
votes
2
answers
7k
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 ...
0
votes
1
answer
724
views
calling fsync() on in-memory files
From fsync(2):
fsync() transfers ("flushes") all modified in-core data of (i.e., modified
buffer cache pages for) the file referred to by the file descriptor fd to
the disk device (or other ...
2
votes
1
answer
599
views
Processor not seeing changes to POSIX shared memory?
Context: I am using POSIX shared memory to provide a set of processes with a shared memory space. I have used this scheme for some time now in order to share data, and it's working okay. However, I ...
1
vote
1
answer
1k
views
Is the shared library object loaded as shared memory for the program?
I was coding some C when I started asking myself about free() inside a shared library and SIGKILL, and so on. Then, after some reading and re-thinking, I came up to this simple question.
CONTEXT : ...
1
vote
0
answers
501
views
Two processes sharing memory under different privileged users
I have two processes sharing memory (via Boost Interprocess). Each process is run under a different user. The first process is run from one of our privileged users.
The second process is ran via a ...
15
votes
1
answer
1k
views
Is it wrong to think of "memfd"s as accounted "to the process that owns the file"?
https://dvdhrm.wordpress.com/2014/06/10/memfd_create2/
Theoretically, you could achieve [memfd_create()] behavior without introducing new syscalls, like this:
int fd = open("/tmp", O_RDWR | ...
1
vote
1
answer
1k
views
Change ownership of shared memory
When I run ipcs -m, I can see a list of the shared memory segments on the system, like
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
...
0
votes
1
answer
216
views
Programs started to fail suddenly with messages pertaining to shared memory
No idea why this is happening it's the first time I see this error. There seems to be enough space left in ram and drive.
First vnc fails now if I don't run it with -noshm option. Second one that ...
4
votes
1
answer
7k
views
Sharing file descriptors
If file descriptors are specific to each process (i.e. two processes may use the same file descriptor id to refer to different open files) then how is it possible to share transfer file descriptors (e....
4
votes
0
answers
1k
views
Why does `/dev/shm` on an EC2 instance have I/O throughput comparable to an EBS drive?
I recently learned about the convenient "shared memory" file system at /dev/shm. I wanted to see if I could use this to speed up a sometimes-disk-bound program that writes to and reads from a ...
0
votes
1
answer
578
views
Issues due to independent concurrent writes to shared memory
Actually I would like to know the issues caused by independent concurrent writes to shared memory.
To be more elobarote, consider we have three processes (proc1, proc2, proc3).
These 3 processes are ...
1
vote
1
answer
642
views
Interpetation of /proc/sys/kernel/shmall
Unless I am wrong. the value of /proc/sys/kernel/shmall indicates the the total amount of shared memory, in bytes, that can be allocated to the system.
I am on a t2.micro ec2 debian instance, and I ...
-2
votes
1
answer
512
views
2GB of shared memory used as shown in free [closed]
OS: Ubuntu 16.04
free output indicated about 2GB of shared memory.
The shared memory was still allocated after a logout, and no particular process from top list was occupying it.
ipcs -m did not ...
14
votes
1
answer
16k
views
Understanding mmap
I was going through documentation regarding mmap here and tried to implement it using this video.
I have a few questions regarding its implementation.
Does mmap provide a mapping of a file and return ...
10
votes
2
answers
7k
views
Where does Linux set the default values for SHMMAX?
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
...
2
votes
2
answers
4k
views
How is memory corruption handled by Linux when the process terminates?
There are many questions on Stack Overflow asking about how a system handles memory leaks and what happens on abnormal termination. Examples:
https://stackoverflow.com/questions/6727383/dynamically-...
1
vote
0
answers
206
views
How to fetch semaphores and sharedmem objects for a specific apache instance when more than one apache instances run with the same app id on the box
Not sure if the question is pertinent for this forum.
We have a server with 3 apache instances running with the "same" app/functional ID
These instances communicate with their corresponding ...
1
vote
1
answer
860
views
Across systems, How a process communicate with other process?
I have learnt below IPC mechanisms,
BSD style half-duplex pipes
SYSV style message queues
SYSV style semaphore sets
SYSV style shared memory segments
BSD style sockets
Half-duplex pipe can be used ...
5
votes
1
answer
6k
views
How to know shared memory between two processes?
I need to know the amount of memory shared between two processes, that is, the intersection of their shared memories.
Any ideas?
1
vote
0
answers
101
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 ...
4
votes
1
answer
6k
views
How can i calculate the size of shared memory available to the system
According to the rhel document, the total amount of shared memory available on the system equals to shmall*PAGE_SIZE.
After I completed the installation of RHEL6, the value of the shmall kernel ...
1
vote
0
answers
774
views
Discrepancy between shared memory from /proc/meminfo and ipcs
Running free -hm outputs:
total used free shared buffers cached
Mem: 15G 15G 389M 321M 169M 11G
-/+ buffers/cache: ...
0
votes
0
answers
238
views
How do you install Oracle on Linux when you get the error "ORA-27101: shared memory realm does not exist"?
I am installing Oracle 11 on CentOS 7.2. I have installed it before on servers with less RAM.
I get this error:
ORA-01034: ORACLE not available ORA-27101: shared memory realm does
not exist
...
1
vote
1
answer
2k
views
Limit memory usage of a user
I have a computing cluster of 44 cores and 256GB memory running Ubuntu and I'd like to limit the number of CPUs and memory used by certain users. Limiting memory usage would be more important. So for ...
3
votes
1
answer
14k
views
Kernel parameter SHMALL and SHMAX [closed]
I am using Red Hat Enterprise Linux Server release 5.11 (Tikanga) as OS and rdbms is 11gR2 software. I have created a database with memory_target=3 GB and
physical RAM=7 GB. My DB service is getting ...
1
vote
1
answer
1k
views
Unix Domain Socket with VM
Is it a true statement that, shared memory does not work between a host OS and guest OS, but a Unix Domain Socket (specifically udp) can communicate between the two?
An in depth explanation would be ...
2
votes
1
answer
969
views
non-reentrant libraries in shared memory?
I found this Q&A saying shared libraries can be shared between processes using shared memory. It seems like it would be impossible, though, to share code between processes without some pretty ...
2
votes
0
answers
1k
views
Extremely high shmem usage
I'm trying to debug the issue that's periodically taking down my work machine. It's an OOM-type problem, and based on this /proc/meminfo output:
Total: 32902608 kB
MemFree: 4054100 kB
...
1
vote
1
answer
2k
views
determine the actual memory usage of several processes that share a large memory segment
I just took a look at the output of top and it showed me (amongst other processes) the following:
As once can see I have ten processes consuming approx 10GB each so 100GB in total. The computer ...