首页 > Linux操作系统 > Linux操作系统 > see how much RAM exists on your server

see how much RAM exists on your server

原创 Linux操作系统 作者:v_fantasy 时间:2009-04-13 23:17:13 0 删除 编辑

Display RAM Size on HP/UX

In HP/UX, the dmesg command can display memory information:

L 5-12

Memory Information:
physical page size = 4096 bytes, logical page size = 4096 bytes
Physical: 5242880 Kbytes,lockable: 4051216 Kbytes,available: 4651796 Kbytes

Display RAM Size on AIX

In IBM's AIX dialect of UNIX, you must issue two separate commands. You start with the lsdev command followed by the lsattr command to display the amount of memory on a server. First, execute lsdev to list all devices. Then pipe that output through grep to filter out everything not related to memory. That will get you the name of the memory devices that are installed. For example:

L 5-13

>lsdev -C|grep mem

mem0       Available 00-00           Memory

Here you can see that mem0 is the name of the memory device. Now that you have the name, you can issue the lsattr 朎l command to see the amount of memory on the server. In the following example, the server has 3GB of RAM installed.

L 5-14

>lsattr -El mem0

size     3064 Total amount of physical memory ?/font>

You must issue the lsattr 朎l command separately for each memory device.

Display RAM Size on Solaris

The prtconf command can also be used on all Solaris servers to quickly see the amount of available memory:

L 5-15

>prtconf|grep -i mem

Memory size: 2048 Megabytes
    memory (driver not attached)
    virtual-memory (driver not attached)

Display RAM Size in Linux

In Linux, the free command can be used to quickly display the amount of RAM memory on the server:

L 5-16

             total       used       free     shared    buffers     cached
Mem:       3728668     504688    3223980      41316     430072      29440
-/+ buffers/cache:      45176    3683492
Swap:       265032        608     264424

Using the Top Utility for Displaying RAM

While each dialect has unique mechanisms and commands to display RAM, most UNIX servers support the top utility. The top utility is invoked by issuing the top command from the UNIX prompt. This will display the total amount of RAM available, and will also show the usage of both RAM and virtual memory:

L 5-17

root> top

  9:43am  up 16 days, 22:33, 24 users,  load average: 0.00, 0.00, 0.00
123 processes: 122 sleeping, 1 running, 0 zombie, 0 stopped
CPU states:  0.0% user,  0.9% system,  0.0% nice, 99.0% idle
Mem:   257568K av, 244988K used, 12580K free, 88732K shrd,  179772K buff
Swap:  530104K av,   9972K used, 520132K free              15452K cached

22417 oracle    14   0   904  904   668 R       0  0.9  0.3   0:00 top
    1 root       1   0   160  120    88 S       0  0.0  0.0   0:11 init
    2 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kflushd
    3 root       0   0     0    0     0 SW      0  0.0  0.0   0:08 kupdate
    4 root       0   0     0    0     0 SW      0  0.0  0.0   0:00 kpiod

In this example, we see from the top utility that we have 257,568 kilobytes of RAM on the server. The top utility is also great for seeing the top CPU consumer tasks on your server.

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。



  • 博文量
  • 访问量