Chinaunix

标题: 俺8个G的内存怎么只剩几K了,巨怪异! [打印本页]

作者: WUMZ    时间: 2005-05-03 09:53
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
俺8个G的内存怎么只剩几K了,大家能帮我看看这是怎么回事。
vmstat结构如下:
kthr     memory             page              faults        cpu     
----- ----------- ------------------------ ------------ -----------
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
1  2 1252446  4620   0   0   1  42  156   0 1800 9696 6439  1  1 97  2


topas的结果如下:

Kernel    1.8   |#                           |  Reads         7  Rawin         0
User      1.0   |                            |  Writes       16  Ttyout        0
Wait      1.2   |                            |  Forks         0  Igets         0
Idle     95.8   |########################### |  Execs         0  Namei         7
                                                Runqueue    0.0  Dirblk        0
Network  KBPS   I-Pack  O-Pack   KB-In  KB-Out  Waitqueue   0.0
lo0       6.0       15      15     6.0     6.0
en1       4.0       13      10     2.0     6.0  PAGING           MEMORY
                                                Faults       12  Real,MB    8191
Disk    Busy%     KBPS     TPS KB-Read KB-Writ  Steals        0  % Comp     58.5
hdisk1    2.4     30.0       3     0.0    60.0  PgspIn        0  % Noncomp  41.9
hdisk0    0.4      2.0       0     0.0     4.0  PgspOut       0  % Client   37.5
dac1      0.0      0.0       0     0.0     0.0  PageIn        0
hdisk3    0.0      0.0       0     0.0     0.0  PageOut       7  PAGING SPACE
hdisk2    0.0      0.0       0     0.0     0.0  Sios          3  Size,MB   22784
dac0      0.0      0.0       0     0.0     0.0                   % Used      1.4
hdisk4    0.0      0.0       0     0.0     0.0  NFS (calls/sec)  % Free     98.5
hdisk5    0.0      0.0       0     0.0     0.0  ServerV2       0
                                                ClientV2       0   Press:
Name            PID CPU% PgSp Owner             ServerV3       0   "h" for help
oidldapd     548878  0.9 76.0 portal            ClientV3       0   "q" to quit
作者: wozxz    时间: 2005-05-03 16:26
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
楼主把下列输出贴出来看看:
1、lsdev -Cc memory
2、lsattr -El mem#
3、ps aux
另外:
vmstat中sr:fr=42:1,当sr:fr>;1时,都认为有问题。
作者: WUMZ    时间: 2005-05-03 17:36
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
谢谢回复,以下是最新的命令执行结果,小弟是新手,机子也是刚接过来,多谢兄弟的帮助:
# vmstat
kthr     memory             page              faults        cpu
----- ----------- ------------------------ ------------ -----------
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
1  2 1277332 21625   0   0   0  26   92   0 1859 12255 6965  3  1 95  1
# lsdev -Cc memory
L2cache0 Available  L2 Cache
mem0     Available  Memory
# lsattr -El mem#
lsattr: 0514-519 The following device was not found in the customized
        device configuration database:
        mem#
作者: WUMZ    时间: 2005-05-03 17:38
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
# ps aux|head -1;ps aux|sort -rn +5|head -50
USER         PID %CPU %MEM   SZ  RSS    TTY STAT        STIME  TIME COMMAND
portal    536582  0.2  1.0 74192 72988      - A    00时55分09秒  7:53 /oracle/bg
portal    548878  0.9  1.0 89660 65336      - A    00时55分10秒 38:11 oidldapd
portal    569372  0.0  1.0 68716 65000      - A    00时55分19秒  1:11 /oracle/bg
root      356540  0.1  0.0 36084 33876      - A    00时52分02秒  2:34 dsmserv qu
portal    348342  0.0  0.0 50680 30484      - A    00时52分26秒  0:05 ora_pmon_a
portal    983202  0.0  0.0 53276 30276      - A    17时13分45秒  0:01 oracleasdb
portal    950478  0.0  0.0 54808 30268      - A    17时32分37秒  0:01 oracleasdb
portal   1130668  0.0  0.0 51748 30016      - A    16时39分38秒  0:02 oracleasdb
portal   1187966  0.0  0.0 51380 29940      - A    17时46分57秒  0:01 oracleasdb
portal   1040502  0.0  0.0 52524 29940      - A    17时33分51秒  0:01 oracleasdb
portal    913494  0.0  0.0 56124 29892      - A    17时57分25秒  0:00 oracleasdb
portal    880700  0.0  0.0 51280 29872      - A    17时44分58秒  0:01 oracleasdb
portal    835630  0.0  0.0 52008 29872      - A    16时54分46秒  0:01 oracleasdb
portal   1016010  0.0  0.0 52088 29860      - A    17时45分45秒  0:01 oracleasdb
portal   1024210  0.0  0.0 51108 29856      - A    16时07分29秒  0:02 oracleasdb
portal   1061090  0.0  0.0 54996 29844      - A    18时06分41秒  0:00 oracleasdb
portal    946282  0.0  0.0 51828 29808      - A    17时34分11秒  0:01 oracleasdb
portal    905372  0.0  0.0 55032 29804      - A    17时34分17秒  0:01 oracleasdb
portal    778358  0.0  0.0 51184 29720      - A    16时45分32秒  0:01 oracleasdb
portal    978992  0.0  0.0 52132 29708      - A    17时50分37秒  0:00 oracleasdb
portal    843838  0.0  0.0 52956 29668      - A    17时08分32秒  0:01 oracleasdb
portal    995536  0.0  0.0 50728 29660      - A    18时11分30秒  0:00 oracleasdb
portal    962704  0.0  0.0 50652 29652      - A    17时59分54秒  0:00 oracleasdb
portal    831734  0.0  0.0 51420 29616      - A    17时21分30秒  0:00 oracleasdb
portal   1073208  0.0  0.0 53668 29600      - A    17时47分53秒  0:00 oracleasdb
portal    954508  0.0  0.0 49632 29532      - A    17时53分40秒  0:00 oracleasdb
portal    647320  0.0  0.0 51824 29512      - A    17时53分47秒  0:00 oracleasdb
portal    884776  0.0  0.0 50988 29488      - A    17时39分54秒  0:00 oracleasdb
portal    974992  0.0  0.0 49584 29484      - A    17时37分32秒  0:00 oracleasdb
portal   1142950  0.0  0.0 49312 29212      - A    18时18分36秒  0:00 oracleasdb
portal   1101868  0.0  0.0 49988 28816      - A    18时04分27秒  0:00 oracleasdb
portal   1122346  0.0  0.0 48420 28320      - A    18时13分29秒  0:00 oracleasdb
portal    770148  0.0  0.0 49408 28308      - A    17时24分36秒  0:00 oracleasdb
portal   1146986  0.0  0.0 51128 28272      - A    17时54分10秒  0:00 oracleasdb
portal   1065098  0.0  0.0 48124 28024      - A    18时20分43秒  0:00 oracleasdb
portal    307378  0.0  0.0 48844 27944      - A    00时52分27秒  0:00 ora_s000_a
portal    942210  0.0  0.0 47804 27704      - A    18时12分51秒  0:00 oracleasdb
portal    798818  0.0  0.0 47556 27456      - A    17时57分34秒  0:00 oracleasdb
portal    458990  0.0  0.0 48256 27244      - A    00时54分07秒  0:00 ora_arc1_a
portal    639154  0.0  0.0 47084 26984      - A    18时11分18秒  0:00 oracleasdb
portal    868400  0.0  0.0 48560 26716      - A    17时44分37秒  0:00 oracleasdb
portal   1171572  0.0  0.0 46808 26708      - A    17时57分13秒  0:00 oracleasdb
portal    786478  0.0  0.0 48612 26708      - A    16时45分34秒  0:00 oracleasdb
portal   1183918  0.0  0.0 48488 26684      - A    18时33分10秒  0:00 oracleasdb
portal   1036418  0.0  0.0 46576 26476      - A    17时41分25秒  0:00 oracleasdb
portal   1118370  0.0  0.0 46560 26460      - A    17时45分37秒  0:00 oracleasdb
portal   1077358  0.0  0.0 46556 26456      - A    17时28分45秒  0:00 oracleasdb
portal    815286  0.0  0.0 48352 26448      - A    18时14分09秒  0:00 oracleasdb
portal   1069138  0.0  0.0 46532 26432      - A    17时51分58秒  0:00 oracleasdb
portal   1126652  0.0  0.0 46500 26400      - A    18时23分59秒  0:00 oracleasdb
作者: 纳闷    时间: 2005-05-03 22:29
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
没觉得有瓶颈
作者: wozxz    时间: 2005-05-04 09:42
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
谢谢回复,以下是最新的命令执行结果,小弟是新手,机子也是刚接过来,多谢兄弟的帮助:
# vmstat
kthr     memory             page              faults        cpu
----- ----------- ------------------------ ------------ -----------
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
1  2 1277332 21625   0   0   0  26   92   0 1859 12255 6965  3  1 95  1
# lsdev -Cc memory
L2cache0 Available  L2 Cache
mem0     Available  Memory
# lsattr -El mem#
lsattr: 0514-519 The following device was not found in the customized
       device configuration database:
       mem#

改为:
# vmstat
kthr     memory             page              faults        cpu
----- ----------- ------------------------ ------------ -----------
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
1  2 1277332 21625   0   0   0  26   92   0 1859 12255 6965  3  1 95  1
# lsdev -Cc memory
L2cache0 Available  L2 Cache
mem0     Available  Memory
# lsattr -El mem0
作者: WUMZ    时间: 2005-05-04 17:16
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
多谢wozxz,运行结果如下:
$ vmstat
kthr     memory             page              faults        cpu
----- ----------- ------------------------ ------------ -----------
r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
1  1 1309355 15953   0   0   1  27   89   0 1840 10512 6924  2  1 96  1
$ lsdev -Cc memory
L2cache0 Available  L2 Cache
mem0     Available  Memory
$ lsattr -El mem0
goodsize 8192 Amount of usable physical memory in Mbytes False
size     8192 Total amount of physical memory in Mbytes  False
作者: hello_unix    时间: 2005-05-04 17:18
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
8GB没问题啊
作者: gldcan    时间: 2005-05-05 09:16
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
是很正常的,你有oracle数据库在使用,肯定是大部分内存分配给oralce了。没有问题的。
作者: jacy.wu    时间: 2005-05-05 09:29
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
原帖由 "wozxz" 发表:
楼主把下列输出贴出来看看:
1、lsdev -Cc memory
2、lsattr -El mem#
3、ps aux
另外:
vmstat中sr:fr=42:1,当sr:fr>;1时,都认为有问题。


请问sr:fr=42:1  中,说明了什么问题了吗?
作者: DesertEagle888    时间: 2005-05-05 09:58
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
我想是否你做过大文件操作?删除几个没用的大文件,fre就会大了
作者: zlg88    时间: 2005-05-05 14:42
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
你的机器是跑的Oracle 9ias吧??
如果是,请查一下具体的配置,是不是把大量的内存拿来作Cache了呀??
作者: wozxz    时间: 2005-05-05 17:47
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
wozxz 写到:
楼主把下列输出贴出来看看:
1、lsdev -Cc memory
2、lsattr -El mem#
3、ps aux
另外:
vmstat中sr:fr=42:1,当sr:fr>;1时,都认为有问题。


请问sr:fr=42:1  中,说明了什么问题了吗?

sr:fr=42:1说明在换页过程中,通过页替换算法扫描了42个页面,才释放1个页面。
作者: seventh    时间: 2005-05-05 19:29
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
兄弟!vmstat 可不是这么用地。
它的第一行输出是历史的均值,不具备太大的参考意义。
如:vmstat  2
再看第二行以后的输出才有意义
作者: DesertEagle888    时间: 2005-05-06 08:50
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
“fre”并不代表真实的可用的物理内存。

AIX中,若进行文件操作,比如读写,系统会将文件读入内存,这样,看到的"fre"会减少,但不不代表可用的物理内存会减少。

系统内存不够时,会将文件系统占用(topas里,no comp那些)的内存直接释放。当然,这要看参数是怎么定的了(记不得,vmtune里的)。

如果page in , page out不大,就应该没问题。不用太担心fre少
作者: DesertEagle888    时间: 2005-05-06 08:58
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
某些动作需要内存,而若此时内存中free的页已所剩无几,则会有部分内存被直接删除(file memory),或部分内存被换出到paging space中(computational memory)。是直接删除file memory,还是换出computional memory,则由系统参数:numperm,maxperm,minperm及内存页的re-page rate决定。

从前面贴出的topas结果看,comp内存占50%多,因为启动了数据库,估计是数据库占用(oracle分配了4G左右吧?);noncomp占用40%多,估计是文件操作引起(如备份数据库等)。

贴出的topas显示有7个paging out。

如果以上情况正确,则建议调小maxperm(AIX433;对于5, 查查资料吧)。
作者: DesertEagle888    时间: 2005-05-06 09:01
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
对不起 ,刚才没看仔细。

虽然有7个page out,但pgsin为0,而且paging space占用很少。

所以,不用担心。什么都不需要做。注意观察就可以了。
作者: zero_dot    时间: 2005-05-09 12:00
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
楼上,
借此贴问请教:
topas里,comp,noncomp,client这三项分别都是指什么???
还有pagein,pageout 大又说明什么呢???
谢谢。。。
作者: 弱智    时间: 2005-05-10 09:16
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
man topas:


PageIn
  Number of 4K pages read per second over the monitoring interval. This includes
  paging activity associated with reading from file systems. Subtract PgspIn
  from this value to get the number of 4K pages read from file systems per
  second over the monitoring interval.
PageOut
  Number of 4K pages written per second over the monitoring interval. This
  includes paging activity associated with writing to file systems. Subtract
  PgspOut from this value to get the number of 4K pages written to file systems
  per second over the monitoring interval.


MEMORY Displays the real memory size and the distribution of memory in use.

Real,MB
  The size of real memory in megabytes.
% Comp
  The percentage of real memory currently allocated to computational page
  frames. Computational page frames are generally those that are backed by
  paging space.
% Noncomp
  The percentage of real memory currently allocated to non-computational frames.
  Non-computational page frames are generally those that are backed by file
  space, either data files, executable files, or shared library files.
% Client
  The percentage of real memory currently allocated to cache remotely mounted
  files.
作者: 弱智    时间: 2005-05-10 09:18
标题: 俺8个G的内存怎么只剩几K了,巨怪异!
有朋友说Comp指的是malloc()分配占用的空间,
Noncomp一般的是文件缓存。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2