You are not logged in.

#1 2014-11-23 20:36:24

x-yuri
Member
Registered: 2013-01-06
Posts: 160

[SOLVED] my computer freezes occasionally (starts to lag immensly)

Hi,

When it happens, there's constant noise from hard drive, doing something. The mouse pointer is barely reacts to me moving the mouse. I can't switch tasks or I just don't have enough patience to wait for it to complete. Very rarely I manage to close chromium and it's back to normal for a while. Mostly I'm forced to reboot the computer. I believe I saw messages like "Can't fork process" while in this state, if I'm not mistaken. And now that I have to start VMs (virtualbox) things are getting worse. Or so it seems.

I assume this has to do with memory getting all used. There's no memory left and... that I don't really know, because I don't have swap. Because the wiki says: "With more than 2 GB of physical RAM, one can generally expect good performance without a swap partition." And I've got 4 GB of it. Or have I misread the wiki?

So, what's really going on? Is there anything I can check or tell you? Should I create a swap file?

Last edited by x-yuri (2014-12-01 05:37:26)

Offline

#2 2014-11-23 20:45:17

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

Open {,h}top and see what is using your RAM.


Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-11-24 07:22:31

x-yuri
Member
Registered: 2013-01-06
Posts: 160

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

it probably makes sense to set up munin then...

Last edited by x-yuri (2014-11-24 07:43:03)

Offline

#4 2014-11-24 09:03:17

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

Tools like htop or top, free and smem should be enough to monitor your memory usage.

How many virtual machines are you starting at once? How much memory are they set to have available?

Last edited by lucke (2014-11-24 09:03:29)

Offline

#5 2014-11-24 23:37:56

x-yuri
Member
Registered: 2013-01-06
Posts: 160

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

I've got 3 VMs now with 512 MB, 512 MB and 1 GB. But the problem manifested itself _before_ I even installed virtualbox.

Offline

#6 2014-11-25 00:21:17

x-yuri
Member
Registered: 2013-01-06
Posts: 160

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

So, I've got munin running, but as I now can see, it doesn't tell which applications exactly use the memory.

Offline

#7 2014-11-25 12:32:24

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

What's the output of "free -m" and "smem -kt" (as root; it's in the community repo) when you have all your usual programs running?

Offline

#8 2014-11-25 13:05:10

x-yuri
Member
Registered: 2013-01-06
Posts: 160

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3953        1788         365          54        1799        1869
Swap:             0           0           0

$ sudo smem -kt
  PID User     Command                         Swap      USS      PSS      RSS 
 1910 yuri     /usr/lib/chromium/chrome-sa        0    92.0K   109.0K     1.2M 
 1904 yuri     /usr/lib/chromium/chrome-sa        0    96.0K   115.0K     1.4M 
 1572 yuri     gnome-pty-helper                   0   132.0K   145.0K     1.5M 
  967 yuri     xinit /home/yuri/.xinitrc -        0   228.0K   274.0K     2.2M 
  395 avahi    avahi-daemon: chroot helpe         0    96.0K   295.0K     1.6M 
 1006 rtkit    /usr/lib/rtkit/rtkit-daemon        0   296.0K   319.0K     2.2M 
  974 yuri     dbus-launch --exit-with-ses        0   320.0K   367.0K     2.2M 
  511 root     /usr/bin/dhcpcd -q -w enp0s        0   428.0K   440.0K     1.7M 
  384 avahi    avahi-daemon: running [yuri        0   252.0K   475.0K     2.8M 
  328 root     /usr/bin/lvmetad -f                0   528.0K   542.0K     2.0M 
  945 yuri     /bin/sh /usr/bin/startx            0   440.0K   575.0K     3.2M 
 1067 yuri     /usr/lib/GConf/gconfd-2            0   480.0K   647.0K     4.6M 
 1130 yuri     /usr/lib/gvfs/gvfsd-metadat        0   592.0K   674.0K     5.0M 
 1470 yuri     /usr/lib/dconf/dconf-servic        0   628.0K   692.0K     4.5M 
  982 yuri     /usr/bin/dbus-daemon --conf        0   532.0K   698.0K     3.1M 
  521 root     nginx: master process /usr/        0   164.0K   702.0K     2.2M 
  382 bitlbee  /usr/bin/bitlbee -F -n             0   244.0K   770.0K     5.4M 
  383 root     /usr/lib/systemd/systemd-lo        0   748.0K   772.0K     2.6M 
 1065 yuri     /usr/lib/pulse/gconf-helper        0   644.0K   832.0K     5.2M 
  348 root     /sbin/mount.ntfs /dev/sda2         0   596.0K   855.0K     2.5M 
 1071 yuri     /usr/lib/gvfs/gvfsd                0   796.0K   945.0K     6.4M 
  520 yuri     -bash                              0   784.0K   969.0K     3.9M 
 1573 yuri     -bash                              0   788.0K   974.0K     3.9M 
32278 yuri     -bash                              0   788.0K   974.0K     4.0M 
 2672 yuri     -bash                              0   820.0K   993.0K     3.9M 
 1456 yuri     /usr/lib/gvfs/gvfsd-burn --        0   832.0K   994.0K     6.5M 
  985 yuri     /usr/lib/at-spi2-core/at-sp        0   872.0K  1000.0K     5.8M 
 1913 yuri     /usr/lib/chromium/chromium         0   196.0K  1006.0K    14.1M 
12078 yuri     -bash                              0   824.0K  1010.0K     4.0M 
24565 yuri     -bash                              0   824.0K  1011.0K     4.0M 
  416 root     login -- yuri                      0   900.0K  1020.0K     3.4M 
  385 dbus     /usr/bin/dbus-daemon --syst        0   956.0K     1.1M     3.5M 
12270 yuri     /usr/lib/gvfs/gvfsd-http --        0   972.0K     1.2M     7.3M 
 1076 yuri     /usr/lib/gvfs/gvfsd-fuse /r        0     1.1M     1.2M     6.6M 
  516 yuri     /usr/lib/systemd/systemd --        0   684.0K     1.2M     3.7M 
  193 root     /usr/lib/systemd/systemd-ud        0     1.3M     1.4M     3.2M 
  523 http     php-fpm: pool www                  0   124.0K     1.4M     5.9M 
  524 http     php-fpm: pool www                  0   124.0K     1.4M     5.9M 
 4030 yuri     xscreensaver                       0     1.3M     1.4M     4.8M 
  522 http     nginx: worker process              0   920.0K     1.4M     3.7M 
  514 root     /usr/bin/sshd -D                   0     1.2M     1.5M     4.9M 
 1167 root     /usr/bin/wpa_supplicant -u         0     1.4M     1.5M     4.2M 
  975 yuri     /usr/bin/dbus-daemon --fork        0     1.4M     1.6M     3.4M 
32503 yuri     ssh cr                             0     1.3M     1.6M     4.9M 
  518 yuri     (sd-pam)                           0     1.1M     1.6M     2.5M 
25105 root     sudo smem -kt                      0     1.5M     1.7M     5.0M 
    1 root     /sbin/init                         0   940.0K     1.9M     4.6M 
 1013 root     /usr/lib/upower/upowerd            0     1.6M     1.9M     8.2M 
 2196 bitlbee  /usr/bin/bitlbee -F -n             0     1.3M     1.9M     6.5M 
 1967 yuri     /usr/lib/dleyna-renderer/dl        0     1.7M     2.0M     8.1M 
 1145 root     /usr/lib/accountsservice/ac        0     1.9M     2.0M     6.9M 
 1407 yuri     /usr/lib/telepathy/telepath        0     1.4M     2.0M     9.6M 
 1103 yuri     /usr/lib/gnome-settings-dae        0     1.7M     2.0M    11.2M 
 1089 root     /usr/lib/udisks2/udisksd --        0     2.1M     2.3M     7.2M 
  971 yuri     gnome-session                      0     2.2M     2.5M    11.3M 
  338 root     /sbin/mount.ntfs /dev/sdb2         0     2.4M     2.6M     4.3M 
  978 yuri     /usr/lib/at-spi2-core/at-sp        0     2.8M     2.9M     7.7M 
 1136 yuri     /usr/lib/telepathy/mission-        0     2.2M     2.9M    11.3M 
 1911 yuri     /usr/lib/chromium/nacl_help        0     2.8M     3.0M     9.4M 
 1091 colord   /usr/lib/colord/colord             0     2.7M     3.2M     9.6M 
 2193 yuri     irssi                              0     2.8M     3.7M     8.6M 
 1211 yuri     /usr/bin/zeitgeist-daemon          0     3.5M     3.8M    10.0M 
 1239 yuri     /usr/lib/tracker/tracker-mi        0     3.2M     4.1M    15.8M 
 1154 yuri     /usr/lib/gvfs/gvfs-udisks2-        0     3.8M     4.1M    10.7M 
12252 yuri     vim                                0     3.0M     4.3M     8.5M 
 3315 yuri     php-fpm: pool www                  0     1.1M     4.4M    13.1M 
 3316 yuri     php-fpm: pool www                  0     1.2M     4.4M    13.2M 
 3314 yuri     php-fpm: master process (/h        0     1.9M     4.9M    15.2M 
 1121 yuri     /usr/lib/evolution-data-ser        0     3.9M     5.2M    19.5M 
  515 root     php-fpm: master process (/e        0     3.5M     5.3M    13.2M 
 1202 yuri     zeitgeist-datahub                  0     4.7M     5.4M    15.7M 
 1940 yuri     /usr/lib/chromium/chromium         0   552.0K     5.5M    13.1M 
 1201 yuri     /usr/lib/tracker/tracker-mi        0     4.7M     5.5M    17.0M 
 1152 yuri     /usr/lib/caribou/caribou           0     4.6M     5.6M    19.4M 
 1005 yuri     /usr/bin/pulseaudio --start        0     5.6M     6.0M    10.8M 
 1115 yuri     /usr/lib/gnome-shell/gnome-        0     5.1M     6.1M    16.1M 
 1198 yuri     /usr/lib/tracker/tracker-mi        0     5.5M     6.7M    19.0M 
 1185 yuri     /usr/lib/tracker/tracker-ex        0     5.6M     6.7M    19.0M 
 1043 yuri     /usr/bin/gnome-keyring-daem        0     7.2M     7.6M    13.0M 
 1207 yuri     nm-applet                          0     6.1M     8.0M    27.6M 
 2846 yuri     vim                                0     6.9M     8.2M    12.3M 
 1905 yuri     /usr/lib/chromium/chromium         0     3.1M     8.4M    41.4M 
25106 root     python2 /usr/bin/smem -kt          0     8.3M     8.8M    12.1M 
  536 root     /usr/bin/perl -wT /usr/bin/        0     9.9M    10.6M    13.2M 
 1012 polkitd  /usr/lib/polkit-1/polkitd -        0    11.1M    11.2M    16.9M 
 1200 yuri     /usr/lib/tracker/tracker-st        0    10.7M    11.4M    22.0M 
  996 yuri     /usr/lib/gnome-settings-dae        0    10.2M    12.4M    34.3M 
 1127 yuri     /usr/lib/gnome-online-accou        0     8.5M    12.7M    30.0M 
 1936 yuri     /usr/lib/chromium/chromium         0     1.3M    14.1M    49.6M 
 2017 yuri     /usr/lib/chromium/chromium         0    11.9M    14.7M    61.5M 
 1187 yuri     /usr/lib/evolution/3.12/evo        0    10.6M    15.9M    39.4M 
 1359 yuri     /usr/lib/gnome-terminal/gno        0    14.0M    16.2M    34.6M 
 2049 yuri     /usr/lib/chromium/chromium         0    14.3M    17.4M    69.5M 
 1361 yuri     /usr/lib/epiphany/epiphany-        0    16.8M    17.7M    31.1M 
  179 root     /usr/lib/systemd/systemd-jo        0    17.0M    21.2M    27.3M 
  968 yuri     /usr/bin/Xorg.bin -nolisten        0    14.7M    21.8M    37.1M 
 2077 yuri     /usr/lib/chromium/chromium         0    19.3M    23.0M    77.7M 
 2137 yuri     /usr/lib/chromium/chromium         0    20.2M    23.6M    77.3M 
 2160 yuri     /usr/lib/chromium/chromium         0    21.4M    23.6M    56.2M 
24527 yuri     /usr/lib/chromium/chromium         0    17.1M    25.7M    84.7M 
 3333 yuri     /usr/lib/chromium/chromium         0    24.2M    27.6M    81.6M 
 2058 yuri     /usr/lib/chromium/chromium         0    19.9M    28.5M    87.1M 
 2086 yuri     /usr/lib/chromium/chromium         0    26.1M    29.4M    82.6M 
24112 yuri     /usr/lib/chromium/chromium         0    25.5M    29.5M    85.9M 
 1146 yuri     /usr/lib/evolution-data-ser        0    42.1M    44.1M    60.7M 
23728 yuri     /usr/lib/chromium/chromium         0    40.9M    44.4M    98.9M 
 6218 yuri     /usr/lib/chromium/chromium         0    31.7M    47.3M   112.8M 
 2095 yuri     /usr/lib/chromium/chromium         0    44.9M    49.0M   105.1M 
 2054 yuri     /usr/lib/chromium/chromium         0    47.5M    52.4M   110.8M 
12307 yuri     /usr/lib/chromium/chromium         0    59.0M    63.4M   119.8M 
 1992 yuri     /usr/bin/python2 /usr/bin/d        0    65.9M    71.1M    91.1M 
 1313 yuri     /home/yuri/.dropbox-dist/dr        0    84.0M    85.8M    98.7M 
 2187 yuri     /usr/bin/python2 /usr/bin/d        0    93.4M    94.9M   100.9M 
  376 mysql    /usr/bin/mysqld --pid-file=        0   168.8M   168.9M   172.3M 
 1459 yuri     /usr/lib32/skype/skype             0   185.9M   188.1M   191.3M 
 1084 yuri     /usr/bin/gnome-shell               0   191.4M   199.5M   234.6M 
 1901 yuri     /usr/lib/chromium/chromium         0   300.4M   331.8M   405.3M 
-------------------------------------------------------------------------------
  117 10                                          0     1.8G     2.0G     3.6G

Two python processes in the end are of a deluge torrent client. And just in case, memory usage graph, at around 2 am I rebooted the computer and went to sleep.

Offline

#9 2014-11-25 14:22:56

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

Your programs take 2G. If you started all your VMs at once, they'd take another 2G. Chromium can eat much more memory, depending on the number of tabs and their content. You probably have /tmp on tmpfs (it's the default, "df -T" should tell you), thus any data in /tmp occupies RAM.

Running without swap doesn't sound like a great idea, unless you have much more RAM than you use. If you have swap, completely unused stuff can be moved from RAM to swap, and stuff not used for a long time can be moved there when something else wants memory.

When you're out of memory, out-of-memory killer should trigger and kill some process, but sometimes it takes a long time (while the system tries to get memory). You can force its activation with Alt-SysRq-f (https://wiki.archlinux.org/index.php/Ke … uts#Kernel).

I'd suggest creating a swap file. https://wiki.archlinux.org/index.php/Swap#Swap_file

You might also have a look at /etc/security/limits.conf - you could also get failed forks when hitting the process number limit - but your case looks like running out of memory to me.

Last edited by lucke (2014-11-25 14:23:35)

Offline

#10 2014-11-25 14:29:20

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

4G really isn't a lot of RAM these days if you're running full blown desktop environment. I would recommend setting up some swap space one way or another.
If you don't have free space for swap partition, you could create a swap file, or in any situation you could try zswap which is quite easy to set up.

It might be a good idea to close some applications that you may not need running all the time, like skype, nginx(mysql), and close some of those chromium tabs wink

gnome 3 also uses quite a bit of RAM, and I think it might have some memory leaks still, at least with certain video drivers. You can slim it's RAM usage by disabling some components running in background you might not need, like tracker, evolution, zeitgeist to name a few. Restarting gnome-shell could also help temporarily (press alt+f2, type 'r' and press enter)

Offline

#11 2014-11-30 18:41:14

x-yuri
Member
Registered: 2013-01-06
Posts: 160

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

Thanks for your replies, guys. I created a swap file.

But could you elaborate on smem output? USS is supposedly memory used by a program excluding shared memory, PSS is USS + process's proportion of shared memory (shared memory is divided evenly among the processes sharing that memory). But what is RSS? When you said, that my program took 2G, lucke, were you referring to the PSS column?

UPD Shouldn't we edit the wiki? It seems to be not particularly correct.

Last edited by x-yuri (2014-11-30 18:44:59)

Offline

#12 2014-11-30 22:30:32

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

free showed 1.8G used (by the way, cache is also needed for programs to function and not all of it can be dropped), USS and PSS show around 2G too, so i said 2G. RSS is resident set size, it's what top shows (how much RAM a process uses, not taking into account that some of it is shared).

I don't like the idea of not using swap (but I don't have PCs with a lot of RAM). Some don't use it to force OOM killer to trigger earlier (instead of having heavy swapping), I guess, but in your case it doesn't quite work ;-) Still, whether you really need it or not depends on your memory requirements. I guess the wiki isn't wrong per se.

Offline

#13 2014-12-01 05:36:54

x-yuri
Member
Registered: 2013-01-06
Posts: 160

Re: [SOLVED] my computer freezes occasionally (starts to lag immensly)

I guess, I'll mark the thread as solved until something comes up.

Offline

Board footer

Powered by FluxBB