Ubuntu swap分区方案

Ubuntu swap分区方案

什么是Swap分区

Swap space is the area on a hard disk. It is a part of your machine's Virtual Memory, which is a combination of accessible physical memory (RAM) and the swap space. Swap holds memory pages that are temporarily inactive. Swap space is used when your operating system decides that it needs physical memory for active processes and the amount of available (unused) physical memory is insufficient. When this happens, inactive pages from the physical memory are then moved into the swap space, freeing up that physical memory for other uses. Note that the access time for swap is slower, depending on the speed of the hard drive. Do not consider it to be a complete replacement for the physical memory. Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap file(s).

交换空间(Swap space)是指硬盘上的一块区域, 它是计算机虚拟内存的一部分,而虚拟内存是物理内存(RAM)和交换空间的组合。 Swap分区会保存临时不活动的内存页。 当操作系统决定为活跃进程分配需要的物理内存,而可用(未使用)物理内存不足时,就会使用交换空间。 当发生这种情况时,物理内存中不活跃的内存页会被移到交换空间中,释放物理内存供其他程序使用。 注意,交换空间的访问速度比较慢,这取决于硬盘读取的速度。 但不要认为它完全替代了物理内存。 交换空间的形式可以是一个专门的交换分区(推荐),也可以是一个交换文件,或者是交换分区和交换文件的组合。

分配方案

根据物理内存大小分配Swap分区大小,第1列表示物理内存大小,后面3列表示交换分区大小;hibernation 是休眠模式的意思,例如:计算机内存为8GB时,即RAM=8GB,查表可知,在计算机不开启休眠模式的情况下,只用给Swap分区分配3GB的空间;在开启休眠模式的情况下,则可以分配11GB空间给Swap分区;此外,Swap分区最大分配空间不超过内存大小的两倍

    RAM   No hibernation    With Hibernation  Maximum
  256MB            256MB               512MB    512MB 
  512MB            512MB              1024MB   1024MB
 1024MB           1024MB              2048MB   2048MB

    RAM   No hibernation    With Hibernation  Maximum
    1GB              1GB                 2GB      2GB
    2GB              1GB                 3GB      4GB
    3GB              2GB                 5GB      6GB
    4GB              2GB                 6GB      8GB
    5GB              2GB                 7GB     10GB
    6GB              2GB                 8GB     12GB
    8GB              3GB                11GB     16GB
   12GB              3GB                15GB     24GB
   16GB              4GB                20GB     32GB
   24GB              5GB                29GB     48GB
   32GB              6GB                38GB     64GB
   64GB              8GB                72GB    128GB
  128GB             11GB               139GB    256GB
  256GB             16GB               272GB    512GB
  512GB             23GB               535GB      1TB
    1TB             32GB              1056GB      2TB
    2TB             46GB              2094GB      4TB
    4TB             64GB              4160GB      8TB
    8TB             91GB              8283GB     16TB

参考

https://help.ubuntu.com/community/SwapFaq

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值