Tuesday, June 16, 2015

memory - Linux: how to explicitly unswap everything possible?




I've launched something that took lots of memory and now everything lags a lot.
I guess all applications' memory has gone to swap in order to free some space for the memory-intensive process, and now everything is slowly returning to RAM when accessed.



Is there a way to explicitly move everything possible from swap back to RAM? Or maybe not everything, but just some particular processes data?


Answer



I'd recommend allowing the normal Linux memory control swap in the things that are actually used, as they are used.



The only thing I can think off is to turn swap off, then on again




sudo swapoff -a
sudo swapon -a


That assumes you have enough spare physical memory to contain everything in swap...


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...