2

My Computer has been freezing a lot lately, and with no apparent reason.
It freezes even if my usage is 3% CPU and 9% RAM.

I was using Windows 8 until I installed Ubuntu 14.04.

It was really slow, and after some researching, I adopted the idea that Ubuntu 14.04 wasn't really that stable, so I decided I'd download a less resource-heavy distro, so I installed Arch Linux (which is what I'm using to type this now) with GNOME. I'm not having any of the problems I used to have in Ubuntu, except for this mostly annoying freeze that happens to be absolutely random ..

My Fan is working correctly, so it's not temperature, and my drivers are up-to-date (they're the same ones I used on Windows, which I had no problem at all with).

Note that: The Whole OS just freezes, and when I was once able to Alt+F2 (to get to the run-a-command dialog) and managed to type in a command (I was struggling with the keyboard to type) and hit Enter, I got the message: No enough memory .. ? Which is pretty unexpected because I'm using a minimal system (arch linux) with only one application running ..

Edit: Here's my /etc/fstab file

# 
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>   <dump>  <pass>
# /dev/sda3
UUID=2268132b-7cfa-4c55-b773-467c4f691e83   /           ext4        rw,relatime,data=ordered    0 1

/dev/disk/by-uuid/2236F90308C55145 /mnt/2236F90308C55145 auto nosuid,nodev,nofail,x-gvfs-show,user 0 0
/dev/disk/by-uuid/4FF142A03DACFA48 /mnt/4FF142A03DACFA48 auto nosuid,nodev,nofail,x-gvfs-show,user 0 0

lsblk outputs ..

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0      2:0    1     4K  0 disk 
sda      8:0    0 298.1G  0 disk 
├─sda1   8:1    0  69.9G  0 part /mnt/2236F90308C55145
├─sda2   8:2    0  59.2G  0 part /mnt/4FF142A03DACFA48
├─sda3   8:3    0  90.3G  0 part /
└─sda4   8:4    0  78.7G  0 part 
sr0     11:0    1  1024M  0 rom  
  • bbs.archlinux.org or #archlinux on Freenode is probably a better place to debug an issue like this – Nathan Wallace Sep 5 '14 at 18:21
  • Can you run 'lsblk' and include it in the post? I'll also tell you that while arch in a great distro (my preferred) it is not a beginner distro. Mint is a better starter distro. – Steven Walton Sep 5 '14 at 20:46
  • 1
    Just wanted to check, because you do need bash knowledge with arch. Anyway, your partitioning concerns me. First off, I don't see a swap at all, unless you have a 78.7G swap. You'll have memory problems without swap. Your root partition should really not be bigger than 25G, especially when staying minimal. I'd also find a better naming scheme for your home folders (weird set up too). If this solves it I'll write an answer so we can mark it as solved. If not, I'll continue to help, but we'll need more info. – Steven Walton Sep 5 '14 at 21:30
  • 1
    Should have 4G swap. And then you should be fine. – Steven Walton Sep 5 '14 at 23:27
  • 1
    @StevenWalton: This actually solved it ! Unfortunately, I had 4 primary partitions there already so I moved one's contents into another's, deleted the first and resized the other to fit all the contents while sparing 4.3G for swap space, then I added its UUID to /etc/fstab and used swapon -a to use it and (up until now) everything seems to be working correctly ! Post your answer so that I can accept it. – Amr Ayman Sep 6 '14 at 17:19
3

Your problem is that you don't have any swap space. Operating systems require a swap space so that they are able to free up ram space and store it on the hard drive.

What you are going to need to do is reformat your hard drive. Red Hat has a suggest swap size chart here. Load up the arch live cd and repartition and swapon /dev/sdaX. If you need a reference see the Arch Wiki Beginner's Guide.

I'll suggest a partition like the following one.

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 298.1G  0 disk 
├─sda1   8:1    0   100M  0 part /boot
├─sda2   8:2    0    20G  0 part /
├─sda3   8:3    0     4G  0 part [SWAP]
└─sda4   8:4    0   rest  0 part /home

This is just suggested, you can do everything in a single partition and not worry about much (but this is the basic format that most people use). If you are keeping your root partition separate then remember to keep it around 20-25G. This is a security thing, because users should be installing programs into their own folders. You won't run out of space, I promise. Pacman and yaourt will take care of this for you.

2

Here are some points which may help you a bit to diagnose the problem:

  • Run free command to see memory usage
  • Run top and then hit M to sort by memory usage or P to sort by CPU usage to see which program uses your resources
  • Be sure that at /etc/fstab is a line to mount swap - you see swap usage after free
  • look at /var/log/messages or in case you are using systemd run journalctl and search for any warnings/errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.