Sponsored Content
Full Discussion: Shared memory in linux
Operating Systems Linux Red Hat Shared memory in linux Post 302405157 by divyaimca on Thursday 18th of March 2010 04:55:32 AM
Old 03-18-2010
shm/shmfs is the filesystem used by used for temporary storage as tmpfs .
/dev/shm is the physicaly shared memory from RAM which is used to speed up execution in Linux/unix . i.e. if a programme is having a portion of memory that can be shared to another programme if permitted .

We can increase our /dev/shm if we have enough RAM , for better performance .
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shared memory shortage but lots of unused memory

I am running HP-UX B.11.11. I'm increasing a parameter for a database engine so that it uses more memory to buffer the disk drive (to speed up performance). I have over 5GB of memory not being used. But when I try to start the DB with the increased buffer parameter I get told. "Not... (1 Reply)
Discussion started by: cjcamaro
1 Replies

2. Programming

memory sharing - not shared memory -

hi, this is the problem: i want to swap a linked list between 4 processes (unrelated), is there any way i can do that just by sending a pointer to a structure? //example typedef struct node { int x; char c; struct node *next; } node; or i should send the items ( x,c ) by... (9 Replies)
Discussion started by: elzalem
9 Replies

3. Programming

Shared memory in shared library

I need to create a shared library to access an in memory DB. The DB is not huge, but big enough to make it cumbersome to carry around in every single process using the shared library. Luckily, it is pretty static information, so I don't need to worry much about synchronizing the data between... (12 Replies)
Discussion started by: DreamWarrior
12 Replies

4. Programming

Shared memory for shared library

I am writing a shared library in Linux (but compatible with other UNIXes) and I want to allow multiple instances to share a piece of memory -- 1 byte is enough. What's the "best" way to do this? I want to optimize for speed and portability. Obviously, I'll have to worry about mutual exclusion. (0 Replies)
Discussion started by: otheus
0 Replies

5. UNIX for Advanced & Expert Users

Shared Memory

Hi, Using ipcs we can see shared memory, etc.. details. How can I add/remove shared memory(command name)? Thanks, Naga:cool: (2 Replies)
Discussion started by: Nagapandi
2 Replies

6. Red Hat

about shared memory space in Linux !

Dear Friends , I am confused about shared memory in Linux . plz look @ the below output : $ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 126G 61G 59G 52% / tmpfs 1.7G 0 1.7G 0% /dev/shm Here , I see that every time... (1 Reply)
Discussion started by: shipon_97
1 Replies

7. Red Hat

Unable to remove shared memory in Redhat Linux

unable to remove shared memory using ipcrm -m in linux $ ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 32768 root 644 80 2 0x00000000 65537 root ... (4 Replies)
Discussion started by: LinuxLearner
4 Replies

8. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

9. Programming

Linux Shell Piping w/Shared Memory

So I am pretty new to the linux environment, and I am trying to create a shell that uses multiple pipes, and I read online that piping using shared memory space is more efficient than using regular piping. However, I have zero clue how to use shared memory space with pipes. Has anyone done this... (1 Reply)
Discussion started by: Greg_MC
1 Replies
TMPFS(5)						     Linux Programmer's Manual							  TMPFS(5)

NAME
tmpfs - a virtual memory filesystem DESCRIPTION
The tmpfs facility allows the creation of filesystems whose contents reside in virtual memory. Since the files on such filesystems typi- cally reside in RAM, file access is extremely fast. The filesystem is automatically created when mounting a filesystem with the type tmpfs via a command such as the following: $ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs A tmpfs filesystem has the following properties: * The filesystem can employ swap space when physical memory pressure demands it. * The filesystem consumes only as much physical memory and swap space as is required to store the current contents of the filesystem. * During a remount operation (mount -o remount), the filesystem size can be changed (without losing the existing contents of the filesys- tem). If a tmpfs filesystem is unmounted, its contents are discarded (lost). Mount options The tmpfs filesystem supports the following mount options: size=bytes Specify an upper limit on the size of the filesystem. The size is given in bytes, and rounded up to entire pages. The size may have a k, m, or g suffix for Ki, Mi, Gi (binary kilo (kibi), binary mega (mebi) and binary giga (gibi)). The size may also have a % suffix to limit this instance to a percentage of physical RAM. The default, when neither size nor nr_blocks is specified, is size=50%. nr_blocks=blocks The same as size, but in blocks of PAGE_CACHE_SIZE. Blocks may be specified with k, m, or g suffixes like size, but not a % suffix. nr_inodes=inodes The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages, or (on a machine with highmem) the number of lowmem RAM pages, whichever is smaller. Inodes may be specified with k, m, or g suffixes like size, but not a % suffix. mode=mode Set initial permissions of the root directory. gid=gid (since Linux 2.5.7) Set the initial group ID of the root directory. uid=uid (since Linux 2.5.7) Set the initial user ID of the root directory. huge=huge_option (since Linux 4.7.0) Set the huge table memory allocation policy for all files in this instance (if CONFIG_TRANSPARENT_HUGE_PAGECACHE is enabled). The huge_option value is one of the following: never Do not allocate huge pages. This is the default. always Attempt to allocate huge pages every time a new page is needed. within_size Only allocate huge page if it will be fully within i_size. Also respect fadvise(2)/madvise(2) hints advise Only allocate huge pages if requested with fadvise(2)/madvise(2). deny For use in emergencies, to force the huge option off from all mounts. force Force the huge option on for all mounts; useful for testing. mpol=mpol_option (since Linux 2.6.15) Set the NUMA memory allocation policy for all files in this instance (if CONFIG_NUMA is enabled). The mpol_option value is one of the following: default Use the process allocation policy (see set_mempolicy(2)). prefer:node Preferably allocate memory from the given node. bind:nodelist Allocate memory only from nodes in nodelist. interleave Allocate from each node in turn. interleave:nodelist Allocate from each node of in turn. local Preferably allocate memory from the local node. In the above, nodelist is a comma-separated list of decimal numbers and ranges that specify NUMA nodes. A range is a pair of hyphen-separated decimal numbers, the smallest and largest node numbers in the range. For example, mpol=bind:0-3,5,7,9-15. VERSIONS
The tmpfs facility was added in Linux 2.4, as a successor to the older ramfs facility, which did not provide limit checking or allow for the use of swap space. NOTES
In order for user-space tools and applications to create tmpfs filesystems, the kernel must be configured with the CONFIG_TMPFS option. The tmpfs filesystem supports extended attributes (see xattr(7)), but user extended attributes are not permitted. An internal shared memory filesystem is used for System V shared memory (shmget(2)) and shared anonymous mappings (mmap(2) with the MAP_SHARED and MAP_ANONYMOUS flags). This filesystem is available regardless of whether the kernel was configured with the CONFIG_TMPFS option. A tmpfs filesystem mounted at /dev/shm is used for the implementation of POSIX shared memory (shm_overview(7)) and POSIX semaphores (sem_overview(7)). The amount of memory consumed by all tmpfs filesystems is shown in the Shmem field of /proc/meminfo and in the shared field displayed by free(1). The tmpfs facility was formerly called shmfs. SEE ALSO
df(1), du(1), memfd_create(2), mmap(2), set_mempolicy(2), shm_open(3), mount(8) The kernel source files Documentation/filesystems/tmpfs.txt and Documentation/admin-guide/mm/transhuge.rst. Linux 2019-03-06 TMPFS(5)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy