RAM is overloaded

My computer has lately begun to get stuck very often, where I can’t do anything and the screen is completely frozen. I can only move my mouse with no effect. It has happened more and more frequently in the last couple of days and that is very annoying. Always when it happens I have to shutdown the computer manually at the start/shutdown button. To know why this happens I looked in my task-manager and voilà: Very early after I booted my computer the RAM is used to more than 80 % and it increases to more than 90 %. Below are some details of my hardware.

~ >>> inxi -F                                                                                                                                                                               
System:    Host: DP Kernel: 5.9.16-1-MANJARO x86_64 bits: 64 Desktop: GNOME 3.38.3 Distro: Manjaro Linux 
Machine:   Type: Desktop System: Hewlett-Packard product: HP Compaq 8200 Elite SFF PC v: N/A serial: <superuser required> 
           Mobo: Hewlett-Packard model: 1495 serial: <superuser required> UEFI: Hewlett-Packard v: J01 v02.15 date: 11/10/2011 
CPU:       Info: Quad Core model: Intel Core i5-2500 bits: 64 type: MCP L2 cache: 6 MiB 
           Speed: 3378 MHz min/max: 1600/3700 MHz Core speeds (MHz): 1: 3378 2: 3374 3: 3368 4: 3366 
Graphics:  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.10 driver: loaded: intel unloaded: modesetting resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 2000 (SNB GT1) v: 3.3 Mesa 20.3.3 
Audio:     Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel 
           Device-2: Microsoft LifeCam VX-1000 type: USB driver: snd-usb-audio,sonixj 
           Sound Server: ALSA v: k5.9.16-1-MANJARO 
Network:   Device-1: Intel 82579LM Gigabit Network driver: e1000e 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 80:c1:6e:f2:f2:0e 
           Device-2: Realtek RTL8192CE PCIe Wireless Network Adapter driver: rtl8192ce 
           IF: wlp2s0 state: up mac: 34:97:f6:66:68:f6 
Drives:    Local Storage: total: 465.76 GiB used: 149.06 GiB (32.0%) 
           ID-1: /dev/sda vendor: Seagate model: ST500DM002-1BD142 size: 465.76 GiB 
Partition: ID-1: / size: 457.16 GiB used: 149.06 GiB (32.6%) fs: ext4 dev: /dev/sda2 
           ID-2: /boot/efi size: 299.4 MiB used: 280 KiB (0.1%) fs: vfat dev: /dev/sda1 
Swap:      Alert: No Swap data was found. 
Sensors:   System Temperatures: cpu: 35.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 289 Uptime: 29m Memory: 5.7 GiB used: 5.06 GiB (88.9%) Shell: Zsh inxi: 3.2.02

I have also many files in my startup folder which seem to be unnecessary to me. Can I simply delete some files and does it help at all?

/etc/xdg/autostart >>> ls                                                                                                                                                                   
at-spi-dbus-bus.desktop                               cinnamon-settings-daemon-xrandr.desktop             org.gnome.SettingsDaemon.PrintNotifications.desktop
aw-qt.desktop                                         cinnamon-settings-daemon-xsettings.desktop          org.gnome.SettingsDaemon.Rfkill.desktop
backintime.desktop                                    clipit-startup.desktop                              org.gnome.SettingsDaemon.ScreensaverProxy.desktop
blueberry-obex-agent.desktop                          dde-clipboard.desktop                               org.gnome.SettingsDaemon.Sharing.desktop
blueberry-tray.desktop                                dtd-wayland.desktop                                 org.gnome.SettingsDaemon.Smartcard.desktop
blueman.desktop                                       firewall-applet.desktop                             org.gnome.SettingsDaemon.Sound.desktop
caffeine.desktop                                      geoclue-demo-agent.desktop                          org.gnome.SettingsDaemon.UsbProtection.desktop
caribou-autostart.desktop                             gmenudbusmenuproxy.desktop                          org.gnome.SettingsDaemon.Wacom.desktop
cinnamon-settings-daemon-a11y-keyboard.desktop        gnome-keyring-pkcs11.desktop                        org.gnome.SettingsDaemon.Wwan.desktop
cinnamon-settings-daemon-a11y-settings.desktop        gnome-keyring-secrets.desktop                       org.gnome.SettingsDaemon.XSettings.desktop
cinnamon-settings-daemon-automount.desktop            gnome-keyring-ssh.desktop                           org.kde.kdeconnect.daemon.desktop
cinnamon-settings-daemon-background.desktop           gnome-shell-overrides-migration.desktop             org.kde.plasmashell.desktop
cinnamon-settings-daemon-clipboard.desktop            klipper.desktop                                     pamac-tray-budgie.desktop
cinnamon-settings-daemon-color.desktop                mate-settings-daemon.desktop                        pamac-tray.desktop
cinnamon-settings-daemon-cursor.desktop               msm_notifier.desktop                                pulseaudio.desktop
cinnamon-settings-daemon-housekeeping.desktop         nm-applet.desktop                                   snap-userd-autostart.desktop
cinnamon-settings-daemon-keyboard.desktop             org.gnome.DejaDup.Monitor.desktop                   tracker-miner-fs-3.desktop
cinnamon-settings-daemon-media-keys.desktop           org.gnome.Evolution-alarm-notify.desktop            tracker-miner-rss-3.desktop
cinnamon-settings-daemon-mouse.desktop                org.gnome.SettingsDaemon.A11ySettings.desktop       user-dirs-update-gtk.desktop
cinnamon-settings-daemon-orientation.desktop          org.gnome.SettingsDaemon.Color.desktop              xapp-sn-watcher.desktop
cinnamon-settings-daemon-power.desktop                org.gnome.SettingsDaemon.Datetime.desktop           xembedsniproxy.desktop
cinnamon-settings-daemon-print-notifications.desktop  org.gnome.SettingsDaemon.DiskUtilityNotify.desktop  xfce4-clipman-plugin-autostart.desktop
cinnamon-settings-daemon-screensaver-proxy.desktop    org.gnome.SettingsDaemon.Housekeeping.desktop       xfce4-power-manager.desktop
cinnamon-settings-daemon-smartcard.desktop            org.gnome.SettingsDaemon.Keyboard.desktop           xfce-polkit-gnome-authentication-agent-1.desktop
cinnamon-settings-daemon-sound.desktop                org.gnome.SettingsDaemon.MediaKeys.desktop          xfsettingsd.desktop
cinnamon-settings-daemon-wacom.desktop                org.gnome.SettingsDaemon.Power.desktop              xscreensaver.desktop

Does someone know how to fix this issue? Thank you in advance.

Look at setting up a swapfile, I did something like

fallocate -l 8G /swapfile
mkswap /swapfile
swapon -s
cat /proc/sys/vm/swappiness\
sysctl vm.swappiness=50\

I think that’s all - do a search :wink:
I think swapfile is better than a partition if you have SSD.

I forgot fstab…

sudo bash -c "echo /swapfile none swap defaults 0 0 >> /etc/fstab"

I think you’re missing stuff:

sudo fallocate -l 8G /swapfile
sudo mkswap /swapfile
sudo chmod u=rw,go= /swapfile
sudo swapon /swapfile
sudo bash -c "echo /swapfile none swap defaults 0 0 >> /etc/fstab"

That should work.

https://wiki.manjaro.org/index.php?title=Swap#Using_a_Swapfile

2 Likes

: 1609918220:0;sudo chmod u=rw,go= /swapfile

Yes, sorry - missed that one from my history.

But I have a HDD. Is a swapfile still better?

Regardless if you have a HDD or SSD, I personally recommend a swapfile over a /swap partition. It’s a lot easier to setup and manage if needed.

1 Like

Ok thanks :+1: I’ll see if it helps

Check with htop to find out what is eating your RAM. Maybe a program is misbehaving and taking all RAM.

I always had partitions until I had issues swapping out my SSD with hooks etc and just installed without swap or hibernation.

I made the swapfile and really didn’t notice a difference - so why bother with partitions? Just a few commands and it’s done. Seems to work well… and I tested Hibernate too.

I found that adjusting ‘swappiness’ was key to stop my RAM filling up (I previously followed a guide that reduced my swappiness too much, so my 8GB RAM was not enough for Firefox any more…) which is why I included a command to put it (up for me) at around 50 - and you can search and change that number if it’s not right for your mystery system.

The swapfile is very helpful and now my computer haven’t freezed since I made one! The RAM is still very much used and it seems like google chrome is the main reason. There’s a photo of my task-manager below. “Speicher” means memory so that’s the column you should look into.

Yeah, it all seems to be chrome and discord (which is an electron app, so chrome based too). :slight_smile:

1 Like

Yeah but is it normal that it takes so much RAM away?

It all depends on your use of the browser, but yes. Seems likely.

Yes, it’s designed that way.
Don’t use Chrome, problem solved.