I am confused why my computer keeps hanging after a few hours. Typically, I have these open
Firefox, with around 10 tabs total
Discord in the background
Slack
Maybe a terminal and/or Dolphin file explorer
Usually, with these one it’s typically at 80-90% already. It would be nearing 95% more often if I have Discord actually open. Also, when I would have VSCode running, it would almost always get to a 100% and make my computer hang.
What makes me really confused is that when I run these same programs on Windows 10, it never hangs and reaches 100%. (Like I thought Windows is supposed to be slower). What should I do to reduce memory usage?
I have 8GB RAM, and currently no swap (just haven’t gotten around to it yet since I wasn’t given the option to make a swap partition on installing EndeavourOS for some reason).
You could run htop and check what actually takes up most RAM. Else it’s mostly guess work. I don’t use slack or discord, but never reach 8 Gb on Firefox…
What desktop environment are you using? Bear in mind that desktop environments use a lot more ram compared to something like a window manager. For example, even a lightweight DE like xfce uses twice as much RAM at boot up compared to something like i3.
After a quick web search, I found that Discord’s ram usage is generally around 50 to 600 MB whereas Slack’s can reach as high as 1 GB.
Windows 10 is a memory hog. I know this because Windows 10 was the last OS i used before switching to Linux. And in terms of resources efficiency, Windows is nowhere near as efficient as Linux.
If you’re noticing high ram usage on Linux compared to Windows, then the culprit must be one of the applications you’re running—there could be memory leaks introduced by one of the applications you were using. If you’re using a lot of plugins on Firefox, I recommend disabling them and then check the ram usage again.
Also, please bear in mind that there has been reports by Discord users on Linux that Discord was leaking memory.
I changed up my htop to make it into a tree view so it doesn’t show duplicate processes, but can’t sort it automatically by memory. The largest ones were these ones by manual inspection:
Everything else was about 2% big at most.
As for the desktop environment, I’m using KDE, which would be the most RAM-consuming one of them. But yeah, as I pointed out, my Windows just does fine however, so I do agree it’s most likely an application. But I don’t see how Discord, Slack, and Firefox could contribute so much when htop only shows like around 60% total at most (Slack and Discord total around 20%). Is it possible that htop could be not actually showing the true amount of memory usage for each application?
Also, I have 8 Firefox extensions, disabling all of them only decreased RAM usage by around 5-10%, I still don’t know where all the other RAM usage comes from.
That usage looks pretty normal to me? Firefox and with tabs and extensions is going to eat quite a bit. I’m running about 4G Mem usage on my machine right now as well. As far as your system hanging when your Mem gets full; It doesn’t look like you have any swap space? I don’t know if you’re using a partition or a swapfile but make sure it’s mounted. Finally, you might like bpytop for montoring too.
Normally, I base my RAM usage on this widget in my taskbar:
CPU usage on the left and RAM usage on the right. It always hangs whenever the right one reaches 99% (with the CPU usage also getting to 99%). However, the number shown here doesn’t usually correspond to what htop shows. At this screenshot^, htop says 4.10/7.57 ~ 54%.
free -h output:
total used free shared buff/cache available
Mem: 7.6Gi 4.0Gi 155Mi 1.4Gi 3.4Gi 1.9Gi
Swap: 0B 0B 0B
It looks like the available space does correctly correspond to the taskbar status widget, but not with htop.
I would keep an “steady” eye on htop while using the system normally.
See what process is causing the high CPU and RAM usage.
Could it be some file indexing, like baloo? Something else? Perhaps you’ll capture the culprit.
Also having a swap device might help avoiding Out of Memory situations. Worth considering.
There are other, less resource-hungry DEs or WMs out there. Just saying. 8Gb of RAM isn’t much for what you’re attempting to do. I doubt, that enabling swap will solve the issue for good. Some websites, such as youtube really eat up a lot of memory and cpu-power as well, due to their heavy usage of JS and 3rd party resources. That goes for discord, too.
I agree 100% too many tabs, running discord and slack? This is something i wouldn’t ever do especially with only 8 Gb memory. I have 32GB and i still wouldn’t do it. I have never in all the years using a computer used on a regular basis multiple tabs except maybe on occasion i might have opened a couple.
@ricklinux Agreed. The OP could switch to something like i3 for more efficient memory use if he intends to put that much load on his system without adding the amount of physical ram installed.
However, the OP did mention something that seems kind of strange to me. He said:
This doesn’t seem to fit with my own experience as a former user of Windows 7, 8.1, and 10. Even “resource hungry” distros like Ubuntu doesn’t use as much memory as Windows 10 does (nearly 2.0GB on boot up and up to 4 GB with only two browser tabs running).