您现在的位置是: 网站首页 >服务部署 服务部署
腾讯云1G内存显示只有800多M解决办法
admin2019年3月12日 16:50 【Linux 】 1083人已围观
腾讯云1核1G机器,显示内存只有800多M ```bash # free -h total used free shared buff/cache available Mem: 868M 700M 70M 4.4M 97M 50M Swap: 0B 0B 0B ``` 客服回答,云架构不一样。 解决方法(**Debian9**) ```bash root@Svr:# cd /etc/default/grub.d/ root@Svr:/etc/default/grub.d# pwd /etc/default/grub.d root@Svr:/etc/default/grub.d# ls -l total 8 lrwxrwxrwx 1 root root 39 Jul 17 2017 kdump-tools.cfg -> /etc/default/grub.d/kdump-tools.default -rw-r--r-- 1 root root 57 Mar 12 16:32 kdump-tools.default -rw-r--r-- 1 root root 137 Jan 5 2017 kdump-tools..ppc64el root@Svr:/etc/default/grub.d# cat kdump-tools.cfg GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=384M-:128M" root@Svr:/etc/default/grub.d# cat kdump-tools.default GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=384M-:128M" root@Svr:/etc/default/grub.d# cat kdump-tools..ppc64el GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT crashkernel=2G-4G:320M,4G-32G:512M,32G-64G:1024M,64G-128G:2048M,128G-:4096M@32M" # 将 crashkernel=XXX 的字段去掉 # 然后执行update-grub2 # 再执行service kdump-tools stop root@Svr:/etc/default/grub.d# update-grub2 Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.9.0-3-amd64 Found initrd image: /boot/initrd.img-4.9.0-3-amd64 done root@Svr:/etc/default/grub.d# service kdump-tools status ● kdump-tools.service - Kernel crash dump capture service Loaded: loaded (/lib/systemd/system/kdump-tools.service; enabled; vendor preset: enabled) Active: active (exited) since Fri 2019-03-08 17:08:27 CST; 3 days ago Process: 395 ExecStart=/etc/init.d/kdump-tools start (code=exited, status=0/SUCCESS) Main PID: 395 (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 4915) Memory: 0B CPU: 0 CGroup: /system.slice/kdump-tools.service Mar 08 17:08:27 StarMeow-Svr systemd[1]: Starting Kernel crash dump capture service... Mar 08 17:08:27 StarMeow-Svr systemd[1]: Started Kernel crash dump capture service. root@Svr:/etc/default/grub.d# root@Svr:/etc/default/grub.d# root@Svr:/etc/default/grub.d# service kdump-tools stop # 最后重启服务器 ``` 验证,真的可以恢复到900多M ```bash # free -h total used free shared buff/cache available Mem: 996M 605M 76M 4.7M 314M 244M Swap: 0B 0B 0B ``` 另外内存清理可查看 《Linux下内存buff cache占用过多问题解决.md》
很赞哦! (0)