Because the maximum size of shared memory needs to be modified, shmmax is stored in/proc/sys/kernel/shmmax in Fedora8. There are two ways to modify the shmmax value. The first type is temporary modification. The operation is very simple. In bashshell, click the following command: # echo "0x40000000" & gt; /proc/sys/kernel/shmmax0x40000000 indicates the maximum size of the shared memory to be modified.
Because the maximum size of shared memory needs to be modified, shmmax is stored in/proc/sys/kernel/shmmax in Fedora 8. There are two ways to modify the shmmax value.
The first is temporary modification. The operation is very simple. In bash shell, click the following command:
# Echo "0x40000000">/proc/sys/kernel/shmmax
0x40000000 indicates the maximum size of the shared memory to be modified, which is 1 GB.
Then you can check the shmmax value in vi to find that the shmmax value has been modified. However, you will find that after the restart, the value will be changed to the original default value of 32 MB.
The second is Permanent modification. Modify/etc/sysctl. conf to make the change permanent. Add the following line to the file. This change takes effect after the system restarts. kernel. shmmax = 0x40000000.
Several parsing operations are included:
Ipcs is used to view information about the shared memory.
Ipcrm is used to eliminate shared memory segments in the system.
I used the system v operation to increase the shared memory, and then shmdt to call the shared memory. When all running processes dt the shared memory, I found that the shared memory still exists, the most important thing is that when I start another process to read data, all the previously written data is in. That is to say, the physical memory does not eliminate the shared memory after all referenced processes are completed. You can view the information of the shared memory segment through ipcs. Therefore, ipcrm-m must be used to remove it.
In another test, when 1 GB of shared memory is allocated, but it is still not allocated in the actual physical memory, it is actually allocated when you use it for the first time.