系統(tǒng)之家 - 系統(tǒng)光盤(pán)下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux內(nèi)存耗盡原因分析

Linux內(nèi)存耗盡原因分析

時(shí)間:2015-08-12 14:03:20 作者:zhijie 來(lái)源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問(wèn): https://m.xitongzhijia.net/xtjc/20150812/55260.html 手機(jī)查看 評(píng)論

  Linux內(nèi)存的使用需要維持在一定的比例內(nèi),如果內(nèi)存占用太高,系統(tǒng)也能運(yùn)行,但是會(huì)影響速度。本文就來(lái)介紹一下Linux中內(nèi)存耗盡應(yīng)該怎么分析?

Linux內(nèi)存耗盡原因分析

  在測(cè)試NAS性能,用fstest長(zhǎng)時(shí)間寫(xiě),分析性能變差的原因,發(fā)現(xiàn)server主機(jī)內(nèi)存使用率很高。

  1.首先查看內(nèi)存# top -M

  top - 14:43:12 up 14 days, 6 min, 1 user, load average: 8.36, 8.38, 8.41

  Tasks: 419 total, 1 running, 418 sleeping, 0 stopped, 0 zombie

  Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.0%id, 0.7%wa, 0.0%hi, 0.0%si, 0.0%st

  Mem: 63.050G total, 62.639G used, 420.973M free, 33.973M buffers

  Swap: 4095.996M total, 0.000k used, 4095.996M free, 48.889G cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

  111 root 20 0 0 0 0 S 2.0 0.0 0:25.52 ksoftirqd/11

  5968 root 20 0 15352 1372 828 R 2.0 0.0 0:00.01 top

  13273 root 20 0 0 0 0 D 2.0 0.0 25:54.02 nfsd

  17765 root 0 -20 0 0 0 S 2.0 0.0 0:11.89 kworker/5:1H

  1 root 20 0 19416 1436 1136 S 0.0 0.0 0:01.88 init

  。。。。。

  發(fā)現(xiàn)內(nèi)存基本用完,究竟是什么進(jìn)程占用?top命令發(fā)現(xiàn)排名第一的%MEM才零點(diǎn)幾。

  2.通過(guò) vmstat -m命令查看內(nèi)核空間的內(nèi)存使用。# vmstat -m

  Cache Num Total Size Pages

  xfs_dqtrx 0 0 384 10

  xfs_dquot 0 0 504 7

  xfs_buf 91425 213300 384 10

  fstrm_item 0 0 24 144

  xfs_mru_cache_elem 0 0 32 112

  xfs_ili 7564110 8351947 224 17

  xfs_Linux/1672.html‘ target=’_blank‘》inode 7564205 8484180 1024 4

  xfs_efi_item 257 390 400 10

  xfs_efd_item 237 380 400 10

  xfs_buf_item 1795 2414 232 17

  xfs_log_item_desc 830 1456 32 112

  xfs_trans 377 490 280 14

  xfs_ifork 0 0 64 59

  xfs_da_state 0 0 488 8

  xfs_btree_cur 342 437 208 19

  xfs_bmap_free_item 89 288 24 144

  xfs_log_ticket 717 966 184 21

  xfs_ioend 726 896 120 32

  rbd_segment_name 109 148 104 37

  rbd_obj_request 1054 1452 176 22

  rbd_img_request 1037 1472 120 32

  ceph_osd_request 548 693 872 9

  ceph_msg_data 1041 1540 48 77

  ceph_msg 1197 1632 232 17

  nfsd_drc 19323 33456 112 34

  nfsd4_delegations 0 0 368 10

  nfsd4_stateids 855 1024 120 32

  nfsd4_files 802 1050 128 30

  nfsd4_lockowners 0 0 384 10

  nfsd4_openowners 15 50 392 10

  rpc_inode_cache 27 30 640 6

  rpc_buffers 8 8 2048 2

  rpc_tasks 8 15 256 15

  fib6_nodes 22 59 64 59

  pte_list_desc 0 0 32 112

  ext4_groupinfo_4k 722 756 136 28

  ext4_inode_cache 3362 3728 968 4

  ext4_xattr 0 0 88 44

  ext4_free_data 0 0 64 59

  ext4_allocation_context 0 0 136 28

  ext4_prealloc_space 42 74 104 37

  ext4_system_zone 0 0 40 92

  Cache Num Total Size Pages

  ext4_io_end 0 0 64 59

  ext4_extent_status 1615 5704 40 92

  jbd2_transaction_s 30 30 256 15

  jbd2_inode 254 539 48 77

  。。。。。。。。

  發(fā)現(xiàn)這兩項(xiàng)值很高: xfs_ili xfs_inode 占用了大量的內(nèi)存。

標(biāo)簽 內(nèi)存

發(fā)表評(píng)論

0

沒(méi)有更多評(píng)論了

評(píng)論就這些咯,讓大家也知道你的獨(dú)特見(jiàn)解

立即評(píng)論

以上留言?xún)H代表用戶(hù)個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場(chǎng)

其他版本軟件

熱門(mén)教程

人氣教程排行

Linux系統(tǒng)推薦

掃碼關(guān)注
掃碼關(guān)注

掃碼關(guān)注 官方交流群 軟件收錄