dynamic allocation of swap disk space
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Silviu Marin-Caea
My desktop has been thrashing the disk for a couple of hours because the swap space was exhausted. And I have the ambition to leave it alone to see if it ever comes out of the thrashing. Of course, it's not usable at all during this time, I'm writing this on the laptop.
You've got a couple problems mixed together here.
(1) Swap space fills up because you have overcommitted memory. In principle, filling up swap space has nothing to do with "thrashing".
(2) "thrashing" is a characteristic of a poorly performing program in a
demand paging virtual memory system typically caused by trying to run a program with a resident size that is smaller than required. Systems can thrash without filling up swap space. It is true that systems can thrash AND fill up swap space, but it is not always so.
You either need (1) more main memory, (2) reduce the number of programs you are running simultaneously, or (3) better behaving programs, or all three. Increasing the amount of swap space will just use more disk. It won't cause your system to stop thrashing since that is driven by what is going on in memory, not what is going on on the disk.
Anyway, if swap space is full, then main memory is (nearly) full, and this is not a good time to do major surgery to your file system (e. g. increase the size of the swap space). You may not be able to allocate the required memory to complete that job and then your system will crash.
Quoted 5 lines
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quote from Ray Bryant <[email protected]>:
Quoted 22 lines
Quoted 8 lines · Silviu Marin-Caea
My desktop has been thrashing the disk for a couple of hours because the swap space was exhausted. And I have the ambition to leave it alone to see if it ever comes out of the thrashing. Of course, it's not usable at all during this time, I'm writing this on the laptop.
You've got a couple problems mixed together here.
(1) Swap space fills up because you have overcommitted memory. In principle, filling up swap space has nothing to do with "thrashing".
(2) "thrashing" is a characteristic of a poorly performing program in a demand paging virtual memory system typically caused by trying to run a program with a resident size that is smaller than required. Systems can thrash without filling up swap space. It is true that systems can thrash AND fill up swap space, but it is not always so.
Quoted 5 lines
You either need (1) more main memory, (2) reduce the number of programs you are running simultaneously, or (3) better behaving programs, or all three. Increasing the amount of swap space will just use more disk. It won't cause your system to stop thrashing since that is driven by what is going on in memory, not what is going on on the disk.
Not necessarily. Increasing swap can allow more physical RAM to be used for caching data from disk.
Imagine a system with limited physical RAM, and limited swap space, running a process which causes a lot of filesystem activity on the same physical disk as is being used for swap. If the total RAM, both physical and swap is almost completely full, increasing the swap space may allow some data from physical RAM to be swapped out, in favour of caching filesystem data from the disk.
Without knowing more details of the original poster's machine, it's difficult to give specific advice about how to solve the problem.
John.
Quoted 5 lines · John Bradford
Imagine a system with limited physical RAM, and limited swap space, running a process which causes a lot of filesystem activity on the same physical disk as is being used for swap. If the total RAM, both physical and swap is almost completely full, increasing the swap space may allow some data from physical RAM to be swapped out, in favour of caching filesystem data from the disk.
Possible, but wouldn't that imply that the value of /proc/sys/vm/swappiness is very mis-set and causing a too-high estimate of the working set size?
Quote from [email protected]:
Quoted 11 lines · John Bradford
Quoted 6 lines
Imagine a system with limited physical RAM, and limited swap space, running a process which causes a lot of filesystem activity on the same physical disk as is being used for swap. If the total RAM, both physical and swap is almost completely full, increasing the swap space may allow some data from physical RAM to be swapped out, in favour of caching filesystem data from the disk.
Possible, but wouldn't that imply that the value of
/proc/sys/vm/swappinessis very mis-set and causing a too-high estimate of the working set size?
Yes - to be honest, I was thinking of very low spec systems, where swap may well be less than or equal to physical RAM size.
John.
Hi John,
Quoted 10 lines · John Bradford
Not necessarily. Increasing swap can allow more physical RAM to be used for caching data from disk.
Imagine a system with limited physical RAM, and limited swap space, running a process which causes a lot of filesystem activity on the same physical disk as is being used for swap. If the total RAM, both physical and swap is almost completely full, increasing the swap space may allow some data from physical RAM to be swapped out, in favour of caching filesystem data from the disk.
Hmmm... Lets see, we have a program (or set of programs) in memory that is thrashing, i. e. it is page faulting at a rate that is higher than the vm system can supply pages, so it is spending its time waiting for pages and the disk subsystem is busy. Now, if we increase the amount of data cached from disk, without increasing main memory, we've decreased the amount of memory available to the thrashing program, perhaps making its problems worse?
Well, I guess all this shows is that with the vm subsystem, speculation is often useless, one has to fire up the box with a carefully constructed workload and see what happens.
Quoted 4 lines
Without knowing more details of the original poster's machine, it's difficult to give specific advice about how to solve the problem.
I certainly agree with that. Time for this thread to die, I think. :-)
Cheers.
Quoted 2 lines
John.
Signature · 9 lines
Best Regards,
Ray
-----------------------------------------------
Ray Bryant
512-453-9679 (work) 512-507-7807 (cell)
[email protected] [email protected]
The box said: "Requires Windows 98 or better",
so I installed Linux.
-----------------------------------------------Quoted 25 lines · John Bradford
Quote from Ray Bryant <[email protected]>:
Quoted 11 lines
Quoted 7 lines · Silviu Marin-Caea
My desktop has been thrashing the disk for a couple of hours because the swap space was exhausted. And I have the ambition to leave it alone to see if it ever comes out of the thrashing. Of course, it's not usable at all during this time, I'm writing this on the laptop.
Quoted 7 lines
You've got a couple problems mixed together here.
(1) Swap space fills up because you have overcommitted memory. In principle, filling up swap space has nothing to do with "thrashing".
(2) "thrashing" is a characteristic of a poorly performing program in a
demand paging virtual memory system typically caused by trying to run a program with a resident size that is smaller than required. Systems can thrash without filling up swap space. It is true that systems can thrash AND fill up swap space, but it is not always so.You either need (1) more main memory, (2) reduce the number of programs you are running simultaneously, or (3) better behaving programs, or all three. Increasing the amount of swap space will just use more disk. It won't cause your system to stop thrashing since that is driven by what is going on in memory, not what is going on on the disk.
Not necessarily. Increasing swap can allow more physical RAM to be used for caching data from disk.
Quoted 8 lines
Imagine a system with limited physical RAM, and limited swap space, running a process which causes a lot of filesystem activity on the same physical disk as is being used for swap. If the total RAM, both physical and swap is almost completely full, increasing the swap space may allow some data from physical RAM to be swapped out, in favour of caching filesystem data from the disk.
Without knowing more details of the original poster's machine, it's difficult to give specific advice about how to solve the problem.
1 GB RAM desktop machine, with 32 MB swap, kernel 2.6.3. In normal operation, the swap is 80% free. It started the thrashing when I loaded a HUGE page (generated from a database) in konqueror.
The issue is not to solve _my_ problem, I really don't care about it that much, the issue would be to solve this sort of problem for everyone. I've had disk thrashing with filled up swap on a server (kernel 2.4) and that was much worse. Anyway, I'll start using swapd and see what happens. Some time in the future, I'll post here the conclusion.
Quoted 3 lines
thrash without filling up swap space. It is true that systems can thrash AND fill up swap space, but it is not always so.
However the system will also thrash if you have inactive dirty pages without file backing taking up to much main memory. Albeit it is more a theoretical possibilty.
Regards
Oliver