M
M
mik_os2012-03-30 22:13:35
linux
mik_os, 2012-03-30 22:13:35

Linux and swap

There is a working machine with 8GB of RAM, Ubuntu.
There is a situation: 2GB is free (of which about 1.8GB is cached), a new program is launched that wants to eat 1GB.

The question that has been tormenting me for a long time: why, instead of dropping the cache, the system starts swapping, and even so hard that the mouse cursor sometimes freezes?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
ragus, 2012-03-30
@ragus

vm.vfs_cache_pressure
vm.swappiness
to the rescue. customize as you like.

S
shadowalone, 2012-03-30
@shadowalone

These are the problems of the program, for anyone ... further look at the system, it should give up the use of the cache.

Z
Zloy1, 2012-03-31
@Zloy1

Try setting swappiness to 0 echo 0 > /proc/sys/vm/swappiness
I read somewhere that this forces the axis to freeload completely and use all caches before swapping anything. Do you write it? Do you need it?

A
AnViar, 2012-04-02
@AnViar

Is this program a database instance by any chance?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question