vm同swap是否唔同的?

之前上黎問過, 有人說swap即係虛擬記憶體
但最近查過, 發現係兩樣不同的東西, swap係一個分區, vm係一個file
就算windows一樣有swap, 只係無得修改咁解

好似係咪 linux都一樣可以有虛擬記憶體的?
請問應該點整?

可以睇下呢到
http://www.faqs.org/docs/linux_admin/x1752.html

我認知中
linux ge swap space
係virtual memory其中一種implementation
而windows 就係用pagefile

TOP

swap 可以係分區,亦可以係 file.
Windows 為咗令人覺得易用唔駛間partition,所以用 file,而亦因為咁(file 會變大變細) 有時候冇獨立一個分區咁好。
之前上黎問過, 有人說swap即係虛擬記憶體
但最近查過, 發現係兩樣不同的東西, swap係一個分區, vm係一個fil ...
主人 發表於 2010-5-3 01:20

TOP

回復 3# lazyfai

不過Linux上就算用swap file都係fixed size, 加上kernel唔會用一個fragmented既swap file

TOP

本帖最後由 icarus-c 於 2010-5-3 09:05 編輯

Virtual_memory = { physical_ram, swap }
// swap or page is the same thing but different term


Confusion abounds about Microsoft's decision to refer to the swap file as "virtual memory".


http://en.wikipedia.org/wiki/Virtual_memory
http://en.wikipedia.org/wiki/Swap_space
-----------
PS. Microsoft is so evil isn't it... confuses users about VM, teach them x64 instead of x86_64/amd64 ...

TOP

本帖最後由 icarus-c 於 2010-5-3 09:14 編輯

回復 2# windkit


果篇野唔完全正確同outdated, 先有define virtual memory做
using a disk as an extension of RAM so that the effective size of usable memory grows correspondingly
係唔正確
又提到
A swap partition is faster

不過在 http://lkml.org/lkml/2005/7/7/326         Andrew Morton話
None at all.  The kernel generates a map of swap offset -> disk blocks at
swapon time and from then on uses that map to perform swap I/O directly
against the underlying disk queue, bypassing all caching, metadata and
filesystem code
不過kernel 2.6以前可能係swapfile 慢d

TOP

本帖最後由 killerpub 於 2010-5-4 00:43 編輯

喵, delete, delete~

TOP

回復 7# killerpub


  People say that the kernel would want to have a certain amount of swap even you have large amount of ram. Say 200mb of swap will let the kernel to work best
I don't know the technical reason for this,  my guess would be something about memory fragmentation

TOP

回復 8# icarus-c


    dear,

menuconfig has an option to forget swap.

I manage my swap, compcache by hand, nil swap had been no problem at all when I had 768MB (gentoo compile heaven).

Facebook flash games, compcache + 8GB swap isn't enough (4GB base), !#$!$#!@$@#$
I never had a desktop, etc, all resources 係用而用的, 慘慘~

VM 係 virtual memory, VMM 係 manager 吧, 199x  係邊間公司發佈, 果時好興的 , qemm + desqview/X 年代,

用 hdd 做 virtual memory, 果時 ram 慢,  hdd 更慢,
而家 ram 快, hdd 慢,
最快, boot Linux 入 ram , 乜 disk 都唔駛

TOP

回復  killerpub


  People say that the kernel would want to have a certain amount of swap even you ...
icarus-c 發表於 2010-5-4 00:39



    有 bashism,

上術會唔會係   Windows-ism 呢 ??
太老舊嗎 ?

TOP