swapfile takes a long time to âget clearedâ
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
4
down vote
favorite
I have a swap file /swapfile
of 1GB size in accordance with the procedure described in the ubuntu swap faq.
When doing a RAM intensive task, I use the "System Monitor" to check the load on my Memory and my Swap. When the task is done, the Memory load goes down quickly ... however, the Swap load stays high for a very long time and only trickles down very slowly (see image).
When calling sudo swapoff -a && swapon -a
, I can clear the Swap manually ... but I'd rather know:
- Why is Swap taking so long to be cleared?
- Is this impacting the performance?
ram swap
add a comment |Â
up vote
4
down vote
favorite
I have a swap file /swapfile
of 1GB size in accordance with the procedure described in the ubuntu swap faq.
When doing a RAM intensive task, I use the "System Monitor" to check the load on my Memory and my Swap. When the task is done, the Memory load goes down quickly ... however, the Swap load stays high for a very long time and only trickles down very slowly (see image).
When calling sudo swapoff -a && swapon -a
, I can clear the Swap manually ... but I'd rather know:
- Why is Swap taking so long to be cleared?
- Is this impacting the performance?
ram swap
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I have a swap file /swapfile
of 1GB size in accordance with the procedure described in the ubuntu swap faq.
When doing a RAM intensive task, I use the "System Monitor" to check the load on my Memory and my Swap. When the task is done, the Memory load goes down quickly ... however, the Swap load stays high for a very long time and only trickles down very slowly (see image).
When calling sudo swapoff -a && swapon -a
, I can clear the Swap manually ... but I'd rather know:
- Why is Swap taking so long to be cleared?
- Is this impacting the performance?
ram swap
I have a swap file /swapfile
of 1GB size in accordance with the procedure described in the ubuntu swap faq.
When doing a RAM intensive task, I use the "System Monitor" to check the load on my Memory and my Swap. When the task is done, the Memory load goes down quickly ... however, the Swap load stays high for a very long time and only trickles down very slowly (see image).
When calling sudo swapoff -a && swapon -a
, I can clear the Swap manually ... but I'd rather know:
- Why is Swap taking so long to be cleared?
- Is this impacting the performance?
ram swap
asked Apr 19 at 12:33
![](https://i.stack.imgur.com/tfkEC.jpg?s=32&g=1)
![](https://i.stack.imgur.com/tfkEC.jpg?s=32&g=1)
S.A.
1435
1435
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Short answer: if your computer is not acting very slowly, it's fine.
Linux will only get the contents out of swap if they are needed, otherwise, there's no point in loading something that isn't in use from swap into RAM, thereby reducing the cache.
A way to check if your system is being limited by swap is checking
vmstat 1
and looking at the wa
column, which shows how long it takes before a process can run. Also, use a tool such as htop
and see how many processes are in disk sleep(D
).
Also, you should have a bit more swap. According to the SwapFAQ:
RAM(MB) No hibernation With Hibernation Maximum
256 256 512 512
512 512 1024 1024
1024 1024 2048 2048
RAM(GB) No hibernation With Hibernation Maximum
1 1 2 2
2 1 3 4
3 2 5 6
4 2 6 8
5 2 7 10
6 2 8 12
8 3 11 16
12 3 15 24
16 4 20 32
24 5 29 48
32 6 38 64
64 8 72 128
128 11 139 256
If you have 16GB of RAM, you should have between 4GB and 32GB
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Short answer: if your computer is not acting very slowly, it's fine.
Linux will only get the contents out of swap if they are needed, otherwise, there's no point in loading something that isn't in use from swap into RAM, thereby reducing the cache.
A way to check if your system is being limited by swap is checking
vmstat 1
and looking at the wa
column, which shows how long it takes before a process can run. Also, use a tool such as htop
and see how many processes are in disk sleep(D
).
Also, you should have a bit more swap. According to the SwapFAQ:
RAM(MB) No hibernation With Hibernation Maximum
256 256 512 512
512 512 1024 1024
1024 1024 2048 2048
RAM(GB) No hibernation With Hibernation Maximum
1 1 2 2
2 1 3 4
3 2 5 6
4 2 6 8
5 2 7 10
6 2 8 12
8 3 11 16
12 3 15 24
16 4 20 32
24 5 29 48
32 6 38 64
64 8 72 128
128 11 139 256
If you have 16GB of RAM, you should have between 4GB and 32GB
add a comment |Â
up vote
3
down vote
accepted
Short answer: if your computer is not acting very slowly, it's fine.
Linux will only get the contents out of swap if they are needed, otherwise, there's no point in loading something that isn't in use from swap into RAM, thereby reducing the cache.
A way to check if your system is being limited by swap is checking
vmstat 1
and looking at the wa
column, which shows how long it takes before a process can run. Also, use a tool such as htop
and see how many processes are in disk sleep(D
).
Also, you should have a bit more swap. According to the SwapFAQ:
RAM(MB) No hibernation With Hibernation Maximum
256 256 512 512
512 512 1024 1024
1024 1024 2048 2048
RAM(GB) No hibernation With Hibernation Maximum
1 1 2 2
2 1 3 4
3 2 5 6
4 2 6 8
5 2 7 10
6 2 8 12
8 3 11 16
12 3 15 24
16 4 20 32
24 5 29 48
32 6 38 64
64 8 72 128
128 11 139 256
If you have 16GB of RAM, you should have between 4GB and 32GB
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Short answer: if your computer is not acting very slowly, it's fine.
Linux will only get the contents out of swap if they are needed, otherwise, there's no point in loading something that isn't in use from swap into RAM, thereby reducing the cache.
A way to check if your system is being limited by swap is checking
vmstat 1
and looking at the wa
column, which shows how long it takes before a process can run. Also, use a tool such as htop
and see how many processes are in disk sleep(D
).
Also, you should have a bit more swap. According to the SwapFAQ:
RAM(MB) No hibernation With Hibernation Maximum
256 256 512 512
512 512 1024 1024
1024 1024 2048 2048
RAM(GB) No hibernation With Hibernation Maximum
1 1 2 2
2 1 3 4
3 2 5 6
4 2 6 8
5 2 7 10
6 2 8 12
8 3 11 16
12 3 15 24
16 4 20 32
24 5 29 48
32 6 38 64
64 8 72 128
128 11 139 256
If you have 16GB of RAM, you should have between 4GB and 32GB
Short answer: if your computer is not acting very slowly, it's fine.
Linux will only get the contents out of swap if they are needed, otherwise, there's no point in loading something that isn't in use from swap into RAM, thereby reducing the cache.
A way to check if your system is being limited by swap is checking
vmstat 1
and looking at the wa
column, which shows how long it takes before a process can run. Also, use a tool such as htop
and see how many processes are in disk sleep(D
).
Also, you should have a bit more swap. According to the SwapFAQ:
RAM(MB) No hibernation With Hibernation Maximum
256 256 512 512
512 512 1024 1024
1024 1024 2048 2048
RAM(GB) No hibernation With Hibernation Maximum
1 1 2 2
2 1 3 4
3 2 5 6
4 2 6 8
5 2 7 10
6 2 8 12
8 3 11 16
12 3 15 24
16 4 20 32
24 5 29 48
32 6 38 64
64 8 72 128
128 11 139 256
If you have 16GB of RAM, you should have between 4GB and 32GB
answered Apr 19 at 13:50
NerdOfLinux
1,499830
1,499830
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026384%2fswapfile-takes-a-long-time-to-get-cleared%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password