在 VPS 中是什么耗尽了我的 RAM?

Dav*_*key 1 ubuntu memory top

我正在运行,我看到在 502968 KB 中,使用了 48064 KB,剩下 16884 KB 空闲。但是当我查看各个进程时,我发现 mysql 有时会消耗我 9.4% 的 RAM - 但似乎没有其他任何东西消耗任何东西。什么消耗了我所有的内存?

这是顶部的屏幕截图:

top - 20:46:07 up 1 min,  1 user,  load average: 0.18, 0.05, 0.02
Tasks:  81 total,   1 running,  80 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.4 sy,  0.0 ni, 99.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    502968 total,   241236 used,   261732 free,    10488 buffers
KiB Swap:   524284 total,        0 used,   524284 free,   106756 cached

PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
1584 dmackey   20   0 20508 1372 1000 R   0.4  0.3   0:00.01 top
1 root      20   0 26664 2456 1340 S   0.0  0.5   0:00.69 init
2 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kthreadd
3 root      20   0     0    0    0 S   0.0  0.0   0:00.01 ksoftirqd/0
4 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0
5 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker/0:0H
6 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kworker/u:0
7 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 kworker/u:0H
8 root      rt   0     0    0    0 S   0.0  0.0   0:00.00 migration/0
9 root      20   0     0    0    0 S   0.0  0.0   0:00.00 rcu_bh
10 root      20   0     0    0    0 S   0.0  0.0   0:00.24 rcu_sched
11 root      rt   0     0    0    0 S   0.0  0.0   0:00.00 watchdog/0
12 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 cpuset
13 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 khelper
14 root      20   0     0    0    0 S   0.0  0.0   0:00.00 kdevtmpfs
15 root       0 -20     0    0    0 S   0.0  0.0   0:00.00 netns
16 root      20   0     0    0    0 S   0.0  0.0   0:00.00 bdi-default
Run Code Online (Sandbox Code Playgroud)

这是免费的:

            total       used       free     shared    buffers     cached
Mem:        502968     355252     147716          0      10816     111548
-/+ buffers/cache:     232888     270080
Swap:       524284          0     524284
Run Code Online (Sandbox Code Playgroud)

Tom*_*nor 6

没有。

它是 Linux,这就是它的工作方式

它将使用“空闲”内存进行磁盘缓存,因为拥有未充分利用的资源有什么意义?

当一个进程需要更多内存时,它会从内核请求它,并且(通常)获取它。

哦..而且 MySQL 将尽可能多地使用它(如 中的配置/etc/my.cnf),以便将索引、查询和表从磁盘缓存到内存中,从而加快访问速度。