F5F Stay Refreshed Software Operating Systems Linux memory issue Question about memory related problems on Linux system.

Linux memory issue Question about memory related problems on Linux system.

Linux memory issue Question about memory related problems on Linux system.

L
LouisTitou
Junior Member
16
05-15-2023, 04:52 AM
#1
Hey everyone, I just switched to Linux recently. To be honest, it’s not just about games and some essential programs—it’s something I’ve always wanted but hesitated to try. But lately I noticed she seems to be gaining weight, and I’m not sure what she’s consuming. The main issue is that my system is using up a lot of memory, and I’m confused about why.

Yes, I should check the system monitor to see which processes are consuming the most memory, but honestly, they all seem to be trying to save space. You can look at the output from `free -h` and `system monitor (sorted by memory)`. From the free command, I see that the memory labeled `buff/cached` is actually used for caching to speed things up. When it runs out, that memory gets released.

I’ve read about this before, but my system freezes when the total used plus buff/cached exceeds around 15.6GB. For example, if I have a VSCode instance, Chrome with 10 tabs, Unity Editor + Hub, and Discord running, my memory is maxed out and anything more causes the whole thing to crash.

I’m trying to learn more about how Linux handles memory, hoping this helps me fix the problem or find a solution. I really love Linux, but right now I can’t multitask like on Windows—before I hit swap memory, I’d be limited to four times what I could handle. Thanks for your time and attention!
L
LouisTitou
05-15-2023, 04:52 AM #1

Hey everyone, I just switched to Linux recently. To be honest, it’s not just about games and some essential programs—it’s something I’ve always wanted but hesitated to try. But lately I noticed she seems to be gaining weight, and I’m not sure what she’s consuming. The main issue is that my system is using up a lot of memory, and I’m confused about why.

Yes, I should check the system monitor to see which processes are consuming the most memory, but honestly, they all seem to be trying to save space. You can look at the output from `free -h` and `system monitor (sorted by memory)`. From the free command, I see that the memory labeled `buff/cached` is actually used for caching to speed things up. When it runs out, that memory gets released.

I’ve read about this before, but my system freezes when the total used plus buff/cached exceeds around 15.6GB. For example, if I have a VSCode instance, Chrome with 10 tabs, Unity Editor + Hub, and Discord running, my memory is maxed out and anything more causes the whole thing to crash.

I’m trying to learn more about how Linux handles memory, hoping this helps me fix the problem or find a solution. I really love Linux, but right now I can’t multitask like on Windows—before I hit swap memory, I’d be limited to four times what I could handle. Thanks for your time and attention!

X
xdraglon
Junior Member
16
05-15-2023, 01:46 PM
#2
The swap file appears small because Linux typically requires it to be at least as large as available RAM. To prevent swap usage, lower the swappiness setting to a minimal value such as 10 or 0.
X
xdraglon
05-15-2023, 01:46 PM #2

The swap file appears small because Linux typically requires it to be at least as large as available RAM. To prevent swap usage, lower the swappiness setting to a minimal value such as 10 or 0.

A
Aaronman5
Member
72
05-18-2023, 12:40 PM
#3
I focused on maintaining the original look of my host while avoiding any adjustments to system settings I didn’t grasp. The installation matches the standard setup of Manjaro KDE. Following your advice, I’ll disable the swap and experiment with different swap space sizes to observe any effects on system memory behavior.
A
Aaronman5
05-18-2023, 12:40 PM #3

I focused on maintaining the original look of my host while avoiding any adjustments to system settings I didn’t grasp. The installation matches the standard setup of Manjaro KDE. Following your advice, I’ll disable the swap and experiment with different swap space sizes to observe any effects on system memory behavior.

H
Hermie12
Member
57
06-01-2023, 06:52 PM
#4
I was talking about the "swappiness" setting, which controls how actively Linux transfers data between RAM and swap. Most desktop environments use a default of 60. You might want to adjust the swap size to test its effect, but avoid turning off swap entirely since applications rely on it. Manjaro is built on Arch. Here’s the relevant part from the Arch Wiki about changing swappiness: https://wiki.archlinux.org/title/Swap#Swappiness The concern here is that your swap space is likely full, and a higher swappiness could force the OS to keep moving data in but find no room.
H
Hermie12
06-01-2023, 06:52 PM #4

I was talking about the "swappiness" setting, which controls how actively Linux transfers data between RAM and swap. Most desktop environments use a default of 60. You might want to adjust the swap size to test its effect, but avoid turning off swap entirely since applications rely on it. Manjaro is built on Arch. Here’s the relevant part from the Arch Wiki about changing swappiness: https://wiki.archlinux.org/title/Swap#Swappiness The concern here is that your swap space is likely full, and a higher swappiness could force the OS to keep moving data in but find no room.

D
DockLate
Junior Member
48
06-09-2023, 07:28 AM
#5
The issue was resolved by adding more swap space using the provided instructions. I tracked memory usage with `watch -n .2 free -h` while stressing the system, which helped confirm that RAM was being freed and swapped out properly. The test used a swappiness of 10 and a 16GB swap size, showing no freezes or crashes. Now I’m curious about how swap data is managed and what should happen in theory. Despite having 8GB of RAM available, the swap space doesn’t seem to be emptying, which is puzzling.
D
DockLate
06-09-2023, 07:28 AM #5

The issue was resolved by adding more swap space using the provided instructions. I tracked memory usage with `watch -n .2 free -h` while stressing the system, which helped confirm that RAM was being freed and swapped out properly. The test used a swappiness of 10 and a 16GB swap size, showing no freezes or crashes. Now I’m curious about how swap data is managed and what should happen in theory. Despite having 8GB of RAM available, the swap space doesn’t seem to be emptying, which is puzzling.

M
molresa
Junior Member
26
06-09-2023, 05:30 PM
#6
Data that isn't often used is moved to the swap area. The system wants to use the swap quickly if swappiness is high. Calculating precise memory usage is difficult because Linux reserves memory aggressively—every app requests space and only then does the OS search for availability. The Wikipedia explanation about this is poor. Cache information can be reclaimed since it helps speed up filesystem access. Storing data in swap is beneficial because the cache becomes more valuable. I recommend trying a compressed memory swap, which works faster than disk, as a middle ground between RAM and disk swap. On Arch-based systems, the systemd-swap package is available.
M
molresa
06-09-2023, 05:30 PM #6

Data that isn't often used is moved to the swap area. The system wants to use the swap quickly if swappiness is high. Calculating precise memory usage is difficult because Linux reserves memory aggressively—every app requests space and only then does the OS search for availability. The Wikipedia explanation about this is poor. Cache information can be reclaimed since it helps speed up filesystem access. Storing data in swap is beneficial because the cache becomes more valuable. I recommend trying a compressed memory swap, which works faster than disk, as a middle ground between RAM and disk swap. On Arch-based systems, the systemd-swap package is available.