Linux的swap空间需要设置多大?
2017-11-07 23:28
507 查看
无论是windows系统还是linux系统,除了物理内存外,都还有一个虚拟内存。在linux上,虚拟内存被称为swap space。过去以来,虚拟内存的大小应该是物理内存的两倍,但是最近几年来,物理内存的大小至少都有了好几个GB,如果16G内存用32G的swap岂不是太占用硬盘空间?
下图是虚拟内存和交换空间的映射关系,虚拟内存的存在,可以提高电脑的运行速度,所以其存在很有意义。
我们看看redhat的官方答复是怎么说的:
总结起来就是,如果不打算开启休眠功能,物理内存在8G以下,则swap设置为与物理内存一样大。如果物理内存在8G以上,swap空间设置为8G即可。当物理内存大于64G时,不建议开启休眠功能。
以下是Ubuntu的指南,更加细致:(从左至右依次是RAM大小,不开启休眠,开启休眠,最大值)
参考链接如下:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/s2-diskpartrecommend-ppc#id4394007
https://help.ubuntu.com/community/SwapFaq
下图是虚拟内存和交换空间的映射关系,虚拟内存的存在,可以提高电脑的运行速度,所以其存在很有意义。
我们看看redhat的官方答复是怎么说的:
Amount of RAM in the system 物理内存 | Recommended swap space建议的交换空间大小 | Recommended swap space if allowing for hibernation如果开启休眠功能建议的交换空间大小 |
---|---|---|
⩽ 2GB | 2 times the amount of RAM | 3 times the amount of RAM |
> 2GB – 8GB | Equal to the amount of RAM | 2 times the amount of RAM |
> 8GB – 64GB | At least 4 GB | 1.5 times the amount of RAM |
> 64GB | At least 4 GB | Hibernation not recommended |
以下是Ubuntu的指南,更加细致:(从左至右依次是RAM大小,不开启休眠,开启休眠,最大值)
RAM(MB) No hibernation With Hibernation Maximum 256 256 512 512 512 512 1024 1024 1024 1024 2048 2048 RAM(GB) No hibernation With Hibernation Maximum 1 1 2 2 2 1 3 4 3 2 5 6 4 2 6 8 5 2 7 10 6 2 8 12 8 3 11 16 12 3 15 24 16 4 20 32 24 5 29 48 32 6 38 64 64 8 72 128 128 11 139 256
参考链接如下:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/s2-diskpartrecommend-ppc#id4394007
https://help.ubuntu.com/community/SwapFaq
相关文章推荐
- Linux 中交换空间 (swap)应该分多大才好?
- Linux 中交换空间 (swap)应该分多大才好?
- Linux 设置 Swap 空间
- Linux 中交换空间 (swap)应该分多大才好?
- Linux 中交换空间(swap)应该分多大才好?
- Linux学习笔记17——设置开机挂载、内存交换空间(swap)之创建、文件系统的特殊观察与操作
- 一般网站需要多少流量多大空间才够用
- Linux之 增加swap空间
- 攻城狮在路上(叁)Linux(二十五)--- linux内存交换空间(swap)的构建
- 需要多大的空间才能表示一个class objects
- Linux添加虚拟内存解决swap空间不足问题
- 修改linux swap空间的swappiness,降低对硬盘的缓存
- Linux系统增加swap空间大小
- 【装Win7需要多大的硬盘空间】
- Linux Swap交换分区设置
- linux 临时增加swap空间
- 为Linux系统手工添加SWAP空间
- linux增加swap空间
- linux下调整swap空间