From: Blaisorblade <bla...@ya...> - 2005-01-21 12:06:05
|
On Friday 21 January 2005 07:53, Gerhard Hannemann wrote: > Why does it seem that my UML does is not using its swap space? I don't think that this is related to UML itself. I describe the most common possibility below, which is a general Linux VM behaviour, but I don't know if you are experiencing what I describe - run the check I suggest and you'll verify if I guessed right or wrong. If I'm right, then UML is simply not using its swap because there is no reason to use it. And no, 1M of free memory is not always a good one. Read on to understand why. > The memory usage drops down to just 1M The free memory, right? Well, probably it's just cached data. > yet tools such as > top and free never indcate that any swap space is ever being used. > I provide the UML with a 512M swap_fs file and swapon -s > seems to indicate that its available. Well, why should Linux use the swap if there's free memory? Free memory is unused memory, i.e. keeping memory free is mostly useless. It's better to use it as file cache. So even a machine without running processes can have only 1M free, and the rest filled by cache data. And such a machine will never use its swap. (Swapping the file cache is brain-damaged, normally). Look at the "free" output on the 2nd line: -/+ buffers/cache: .... .... It is the important one - it counts the memory which is used excluding the file cache. And it allows you to see if what I described is your situation or not. However, the real problem would be if with free swap space the system went OOM, which is not your case... it happened with the 2.6.9 kernel - because of one VM bug (described on lwn.net/Kernel). But you said in the other message you run a 2.4.27 UML, so it's not your case. (The host kernel being 2.6.9 is unrelated to the swapping inside the guest). -- Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 http://www.user-mode-linux.org/~blaisorblade |