First off, I know that the memory usage as displayed in the System Monitor on Ubuntu isn't definitive. I read all the stuff like this. But consider this:
- I have installed Ubuntu 16.04 dualboot on a MacBook Pro as primary OS
- The MBP has 8GiB memory (7,7GiB to be precise)
- Every other day, my laptop chokes up to the point that nothing response and I can only move my cursor with an insane delay of minutes per inch (in other words; complete freeze)
Ever since this happened I keep the System Monitor open, and every time the system freezes is because the memory usage get's up to 99.99%.
I've tried to use commands such as these
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches and extensions for Chrome to better manage processes and memory usage.
Most of the time I have 5 windows running:
- Chrome browser
- Sublime Text editor
- Nylas mail client
- Terminal window
As I said, I keep a close eye on the memory usage and reboot from time to time when I notice the memory is > 90%, but it happens often that a process (mostly Chrome) has to pull some weight unexpectedly and if that happens, I can sigh, force-quit my machine, and start it again.
Over the course of the day the memory usage seems to grow and grow, and the only way to clear it again is to reboot. On boot, memory usage is usually 40~45% (+- 3,5GiB). At this time I have 4 tabs in chrome, a terminal window, Nylas in the background and spotify, and memory is at 5.5GiB. I already feel the tension for when it's about to choke up again.
The Ubuntu install is pretty clean and fresh; installed it out of the box and didn't do any crazy stuff with it internally; just using it as a regular user.
Now I don't know if this is due the fact that it runs on a MBP and it isn't optimized for it, or that I could tweak the OS to run better on it (i.e. I don't seem to have any swap available), but I think it would be an idea to limit memory usage to say 95% the same way the battery doesn't charge over 90%; to keep from hitting the 100%.
But I'm no power user. I'm also not afraid to dive in the system and tweak stuff (that's why I wanted to use Ubuntu anyway), but at this point I'm not sure where to look for a solution, if there is one anyway. I've read about launching certain processes (like the browser) in containers and limiting those to a certain amount of memory, but I've also read that that is a 'plain stupid idea' because 'it doesn't work that way'.
My current process list for reference:
Edit: At Duncans advise, here is the list of start up processes. As far as I can tell there is nothing too weird about it.
indicator-application start/running, process 1923 unicast-local-avahi stop/waiting update-notifier-crash stop/waiting upstart-udev-bridge start/running, process 1678 update-notifier-hp-firmware stop/waiting xsession-init stop/waiting dbus start/running, process 1687 no-pinentry-gnome3 stop/waiting update-notifier-cds stop/waiting gnome-keyring-ssh stop/waiting gnome-session (Unity) start/running, process 1848 ssh-agent stop/waiting unity7 start/running, process 1881 upstart-dbus-session-bridge start/running, process 1761 gpg-agent start/running indicator-messages start/running, process 1884 logrotate stop/waiting indicator-bluetooth start/running, process 1888 unity-panel-service start/running, process 1851 hud start/running, process 1839 im-config start/running unity-gtk-module stop/waiting session-migration stop/waiting upstart-dbus-system-bridge start/running, process 1764 at-spi2-registryd stop/waiting indicator-power start/running, process 1889 update-notifier-release stop/waiting indicator-datetime start/running, process 1894 indicator-keyboard start/running, process 1895 unity-settings-daemon start/running, process 1841 indicator-sound start/running, process 1898 upstart-file-bridge start/running, process 1768 bamfdaemon start/running, process 1753 gnome-keyring stop/waiting window-stack-bridge start/running, process 1699 indicator-printers start/running, process 1901 re-exec stop/waiting upstart-event-bridge stop/waiting unity-panel-service-lockscreen stop/waiting indicator-session start/running, process 1902
In the start-up apps only flux, GNOME software, Nylas, SSH Key Agent and StackStorage run.