<div dir="ltr">要说swap的用处,就得说系统virtual memory的两种方式:分页和交换。分页是把进程的一部分放入硬盘,而交换则是把整个进程放入硬盘。交换不仅仅发生在ram不足的情况下,更准确地说什么时候交换什么进程是由系统内核控制的。比如服务器上某些daemon进程sleep很长时间、系统设置了某些节能省电模式,你手动去休眠,都会发生交换。交换是系统的virtual memory硬实现的一个策略,不是说你分区时没分swap,内核就不再发生交换了。所以swap是必须的,再大的内存都需要。只不过内存低于2G时,swap一般为内存两倍,大于2G时跟内存一样大或是内存的1/2即可。<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">在 2012年12月18日下午6:46,古户二梨花 <span dir="ltr"><<a href="mailto:komugifan@gmail.com" target="_blank">komugifan@gmail.com</a>></span>写道:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
现在车轮质量越来越好了,是否有必要继续背着第5个轮胎呢<br>
<br>
12/12/18 16:18, 醉言浮生梦 写道:<div class="HOEnZb"><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
现在电脑配置越来越高了,内存的价格也很低了 现在很多内存都是4G以上<br>
在这种环境下我觉得不需再设置swap分区了<br>
<br>
我安装ubuntu,设置了swap分区比没有分的感觉卡一点,<u></u>没有分swap倒很流畅。<br>
-------------- 下一部分 --------------<br>
一个HTML附件被移除...<br>
URL: <<a href="https://lists.ubuntu.com/archives/ubuntu-zh/attachments/20121218/f3efbf82/attachment.html" target="_blank">https://lists.ubuntu.com/<u></u>archives/ubuntu-zh/<u></u>attachments/20121218/f3efbf82/<u></u>attachment.html</a>><br>
</blockquote>
<br>
<br>
-- <br>
ubuntu-zh mailing list<br>
<a href="mailto:ubuntu-zh@lists.ubuntu.com" target="_blank">ubuntu-zh@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh" target="_blank">https://lists.ubuntu.com/<u></u>mailman/listinfo/ubuntu-zh</a><br>
</div></div></blockquote></div><br></div>