Is swap really needed when RAM's aplenty
jd1008 at gmail.com
Thu Aug 19 18:02:27 UTC 2010
On 08/19/2010 10:46 AM, Tim wrote:
> On Thu, 2010-08-19 at 09:22 -0500, Michael Hennebry wrote:
>> I didn't realize that memory could get fragged.
> An old problem, and one reason why some other OSs *needed* occasional
> reboots, after a while. Even quitting all running applications, back
> down to just having the basic desktop, and deliberately issuing flush
> commands, wasn't enough to free up all the RAM. Particularly when
> something needed a big contiguous block, because some (later than boot
> time ran) system things might be sitting in the middle of the RAM.
The FS page cache also tries to cache as much of the filesystem as
it can, in ram.
Even though this is not a real problem, because when ram is needed.
LRU pages are used, and if dirty, they are flushed first before being
re-allocated to a process.
Problem comes as Michael explains, that when a process needs a large
"physically contiguous" chunk of memory, it might not be available.
That said, usually, requests for physically contiguous memory is only
needed when wanting to map very large number of DMA pages for
doing direct physical I/O.
Otherwise, a process itself does not need to have physically contiguous
pages. Only the virtual space allocated to that "malloc" or large buffer
declaration in a program, is contiguous.
More information about the users