I installed Ubuntu a few weeks ago and I usually run more than 6 programs(sts,web browsers, and so on).
The system is getting stuck.
My RAM size is 6 GB and swap 2 GB. I decided to increase swap size to 15 GB. When I was trying to accomplish this work, I got the following error. I have linked to the tutorial that I was following.
sudo swapon --show
[sudo] password for decoders:
NAME TYPE SIZE USED PRIO
/swapfile file 2G 0B -1
decoders@10decoders:~$ free -h
total used free shared buff/cache available
Mem: 5.7G 1.1G 3.4G 217M 1.1G 4.1G
Swap: 2.0G 0B 2.0G
decoders@10decoders:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.9G 0 2.9G 0% /dev
tmpfs 583M 9.0M 574M 2% /run
/dev/sda1 293G 14G 265G 5% /
tmpfs 2.9G 4.7M 2.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
tmpfs 583M 144K 583M 1% /run/user/1000
decoders@10decoders:~$ sudo fallocate -l 15G /swapfile
fallocate: fallocate failed: Text file busy
decoders@10decoders:~$ ls -lh /swapfile
-rw------- 1 root root 2.0G May 19 11:43 /swapfile
decoders@10decoders:~$
I followed this tutorial link: http://www.tutorialspoint.com/articles/how-to-increase-swap-space-on-linux-ubuntu
swapoff -a
first. Secondly, why do you think that increasing swap would solve your problem when your current swapon command shows no swap usage? Lastly, setting is to 15G is excessive. Figure on 6G... 12G max. – heynnema May 31 '17 at 15:41swapoff -a
turns off swap usage. You were trying to allocate 15G to /swapfile, but you can't do that if it's in use. You do aswapoff -a
,fallocate
(you may have to delete the current /swapfile first),mkswap /swapfile
, thenswapon -a
. If you're not sure what you're doing... then don't do it. – heynnema Jun 01 '17 at 12:50top
command to see if there's a process consuming too much CPU time. Seeman top
for more info. – heynnema Jun 01 '17 at 13:45