linux 内存 shared,Linux Shared Memory的查看与设置

Linux Shared Memory的查看与设置

共享内存就是进程之间可以共享的一段内存,通过一个唯一的KEY值绑定

shmget()创建或获取

shmat()连接

shmdt()断连

共享内存的访问涉及同步措施,通常与信号灯一起使用

用ipcs -m命令可以查看系统中已有的共享内存段

/proc/sys/kernel/shm开头的几个文件是共享内存的参数

共享内存的访问涉及同步措施,通常与信号灯一起使用

用ipcs -m命令可以查看系统中已有的共享内存段

ipcs -m 看Shared Memory 共享内存

ipcs -q 看Message Queues 消息队列

ipcs -s 看Semaphore Arrays 信号量

使用命令:ipcs -al

------ Shared Memory Limits --------

max number of segments = 4096

max seg size (kbytes) = 4091826

max total shared memory (pages) = 2097152

min seg size (bytes) = 1

1. Linux Check Memory Usage

by VIVEK GITE on APRIL 6, 2006 · 36 COMMENTS

How do I check used and free RAM memory usage under Linux operating systems using command line and GUI tools?

Linux comes with different set of commands to check memory usage. The free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The vmstat command reports information about processes, memory, paging, block IO, traps, and cpu activity. Finally, you can use the top command which provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel.

free command

Display free memory size in MB:

$ free -mOutput:

total       used       free     shared    buffers     cached

Mem:           750        625        125          0         35        335

-/+ buffers/cache:        254        496

Swap:          956          0        956Displays a line containing the totals memory in MB:

$ free -t -m

Output:

total       used       free     shared    buffers     cached

Mem:           750        625        125          0         35        335

-/+ buffers/cache:        253        496

Swap:          956          0        956

Total:        1707        625       1082

1

2

3

下一页

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值