1.看物理内存用prtconf,在x86和sparc都通用的:

# prtconf -vp | grep Mem Memory size: 1015 Megabytes

2.用vmstat看使用情况:

# vmstat 1 kthr      memory            page            disk          faults      cpu

r b w   swap free re mf pi po fr de sr cd s0 s1 --   in   sy   cs us sy id

0 0 0 1016848 587012 36 117 73 1 3 0 121 11 -0 11 0 475 2930 936 7 2 91

0 0 0 963184 522692 11 27 0 0 0 0 0 0 0 0 0 393 848 273 1 1 98

0 0 0 963184 522732 0   0 0 0 0 0 0 0 0 0 0 399 328 281 0 0 100

0 0 0 963184 522732 0   0 0 0 0 0 0 0 0 0 0 402 1368 283 1 0 99

0 0 0 963184 522732 0   0 0 0 0 0 0 0 0 0 0 387 772 258 0 1 99

0 0 0 963184 522732 0   0 0 0 0 0 0 0 0 0 0 400 1801 274 1 0 99

3.Solaris 9开始,可以使用mdb来查看内存 (输入命令,回车,然后稍等一会才能出结果):

# echo ::memstat |mdb -k Page Summary                Pages                MB %Tot

------------     ---------------- ---------------- ----

Kernel                      26350               102   10%

Anon                        78852               308   31%

Exec and libs               13812                53    5%

Page cache                   8400                32    3%

Free (cachelist)            39009               152   15%

Free (freelist)             91239               356   35%

Total                      257662              1006

 

以上方法查看内存大小及使用情况。