Linux 小白,请教下 Linux 内存占用的问题。 - V2EX
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
Tidycc
V2EX    Linux

Linux 小白,请教下 Linux 内存占用的问题。

  •  
  •   Tidycc Nov 19, 2018 3312 views
    This topic created in 2735 days ago, the information mentioned may be changed or developed.

    系统环境: 服务器上的虚拟机,虚拟机配置如下:

    问题如下:

    长期不关机的时候存在内存占用很高的情况,没有打开任何应用的情况下也是占用很高,这是长时间不关机的情况:

    刚重启的情况:

    请问这种情况的原理是什么?是内存泄漏吗?该怎么解决呢? 谢谢大家的回答-----------

    7 replies    2018-11-21 13:33:46 +08:00
    Nimrod
        1
    Nimrod  
       Nov 19, 2018 via Android
    是不是什么自启软件有内存泄露啊…
    fonlan
        2
    fonlan  
       Nov 19, 2018 via Android
    htop 看下内存占用最大的是哪个进程啊,标准操作吧
    q397064399
        3
    q397064399  
       Nov 19, 2018
    这种问题还是上 stackoverflow 太多了
    srx1982
        4
    srx1982  
       Nov 19, 2018
    把 htop 下边的进程也截图出来就知道了
    cdzone
        5
    cdzone  
       Nov 19, 2018
    应该是 cache 吧,free 看看 buffer cache 和 available 占多少。如果不是那得看看是什么进程占用的了。btw,现在 PC 都这么大内存了么? 32G 啊。。。前两年公司发给我的电脑还是 8G 的
    jasonyang9
        6
    jasonyang9  
       Nov 19, 2018
    赞同 5 楼,没有 swap 是 OK 的。`vmstat`看下也可以。

    To reduce costs of accessing persistent storage, most systems use aggressive caching subsystems to keep popular data in memory. Linux, in this regard, is no different than traditional operating systems.

    The Linux page cache is unified, keeping pages in memory from three primary sources: memory-mapped files, file data and metadata from devices (usually accessed by directly `read()` and `write()` calls to the file system), and heap and stack pages that comprise each process (sometimes called anonymous memory, because there is no named file underneath of it, but rather swap space). These entities are kept in a page cache hash table, allowing for quick lookup when said data is needed.

    blah blah...
    getecho
        7
    getecho  
       Nov 21, 2018
    top 按 M 看进程内存使用情况排序。看占用大的内存的进程名是什么。如果是系统服务就去查系统服务是不是有内存泄漏之内的 bug,不过几率比较低。如果是自己的服务,那就再具体分析。
    About     Help     Advertise     Blog     API     FAQ     Solana     882 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 39ms UTC 20:25 PVG 04:25 LAX 13:25 JFK 16:25
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86