Memory Issue

Heya all,

Peter again :slight_smile: Quick consultation if anyone has tips about memory management. I’m currently using OM 5.x Rock as my main box with my MacBook Air Intel from 2020 :slight_smile:

I’ve been using it daily since the November, 2023. :metal:

Since a few weeks I got some issues with chromekits-web browsers freezing and then self-closing. Today after checking the logs, it looks like I’m out of memory…

janv. 09 16:27:08 concorde kernel: [  30522]     0 30522     4159      192    73728        0             0 systemd-userwor
janv. 09 16:27:08 concorde kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1001.slice/user@1001.service/session.slice/plasma-plasmashell.service,task=brave,pid>
janv. 09 16:27:08 concorde kernel: Out of memory: Killed process 25329 (brave) total-vm:1191043136kB, anon-rss:854992kB, file-rss:256kB, shmem-rss:40400kB, UID:1001 pgtables:3140kB oom_score_adj:300
janv. 09 16:27:08 concorde kernel: Purging GPU memory, 0 pages freed, 0 pages still pinned, 5248 pages left available.
janv. 09 16:27:08 concorde kernel: Purging GPU memory, 0 pages freed, 0 pages still pinned, 5248 pages left available.

I use typically a dozen of tabs while working as a web developer. I tried to enable memory saver features, or tabs saver addons but didn’t help. Remove addons or custom ffmpeg stuff, tested edge, opera, brave, … doesn’t seem to change.

I guess it’s related to my hardware. Classic install with 8G if RAM, swap size is 4Gb and I guess 1G for the shared GPU. I got a least a tab with Slack, Task manager (Monday or Backlog) and a few “heavy” stuff but even with no video / media playing it’s crashing after a few hours of use.

Any help or feedback is welcome.

Cheers and may the mandrake force be with you :bell_pepper:

Open htop in Konsole (terminal) and see what is using to much memory. Then see if it is something that is fixable.

Unfortunately memory is not upgrade-able on the MacBookAir.

Hint for all users: Install fastfetch IMO it has better information than neofetch.

Thank you for the reply Ben :metal:

Actually I already investigated a few days ago and the tabs were consuming the most memory. What I didn’t understand is that it looks like the browser itself - all the tabs - are kicked at once by oom-kill, not one by one :stuck_out_tongue_closed_eyes:

A little digging on the net and I edited the

/usr/lib/systemd/zram-generator.conf

And boosted up to 8Gb the swap size

# This config file enables a /dev/zram0 device with the default settings:
# — size — half of available RAM or 8GB, whichever is less
# — compression — kernel default, most likely zstd
#
# To disable, uninstall zram-generator-defaults or create empty
# /etc/systemd/zram-generator.conf file.
[zram0]
zram-size = 8192
#zram-size = min(ram/2, 8192)

I’m gonna monitor if that can help a bit more for my daily work.

Thanks for the tip about fastfetch, I didn’t know about it :cowboy_hat_face:

About the RAM yeah, macbook air is a super slim light notebook but nothing upgradable :sweat_drops: Next time I guess I will go for the good old classic desktop tower with PCI buses - if that still exists :smirk:

It’s great, I should ask more on the forum. When I’m at the point of giving up, writing a message - not chatting - make my tension down and feels great.
Open Mandriva Counselling :sunglasses:

Keep in touch and have a wonderful day / evening

Unfortunately, oom-kill is very sensitive and kills many processes that it shouldn’t. This is unfortunately quite a common problem for those who use it.

As a solution, you can use this guide and increase the limits:

1 Like

Heya @AngryPenguin :penguin: :penguin: :penguin:
Bad Penguin, Bad Penguin, Bad Penguin, what you gonna do, what you gonna do :musical_note:

Thank you very much for the feedbacks :+1:

It’s interesting but actually it’s killing another app instead right ? :crazy_face:
I didn’t understand everything, it’s a trick to give a higher priority for a specific PID regards to memory management ?

After testing various setup, giving an amount of swap space equal to the amount of my memory worked like a charm !

Screenshot_20240111_013521

If I use too much tabs it’s still crashes but 8giga of swap for 8 giga of RAM is perfect to do a bit of streaming or screen sharing for the video conference :smiling_face_with_three_hearts:

Also you may play with the swappiness value. This can’t solve your problem but it could mitigate a bit. In show the sappiness value is used to control how the kernel uses the swap partition. At high value of swappiness the kernel starts to swap very early when still a lot o RAM memory is free. On the opposite for low value it start to use swap only when the RAM is quite full.

Usually the default value is 60, as you can check with:

cat /proc/sys/vm/swappiness

This means the kernel start to use the swap partition when the RAM is used at 80% which is a good compromise. However in some cases it may be not the best. For example on machine with very low memory (eg. 4GB) I prefer to set swappines at 10.

You may test the value on a running machine with the command:

sudo sysctl vm.swappiness=10

or set permanently with by adding the following at /etc/sysctl.conf

vm.swappiness = 10

then apply the changes:

vm.swappiness = 10
1 Like

Awesome! Thank you @mandian for this wonderful tip :star_struck:
I’m gonna check different value to find out which value would work best with my laptop :face_with_monocle:
Keep in touch!

Also make sure you have enough space in /tmp, which is in RAM.

I meant then apply the changes:

sudo sysctl -p
1 Like

Poke @mandian :wave:
Sorry to disturb you, not in hurry but the “permanent way” does not work on my box :

What I did :

[pierre@concorde ~]$ cat /proc/sys/vm/swappiness
60
[pierre@concorde ~]$ sudo sysctl vm.swappiness=40
[pierre@concorde ~]$ sudo touch /etc/sysctl.conf
[pierre@concorde ~]$ sudo sysctl -p
[pierre@concorde ~]$ cat /proc/sys/vm/swappiness
40

sysctl was complaining the conf file didn’t exist or something like that so I created it. But whatever I write in /etc/sysctl.conf it doesn’t seem to be used by OM :melting_face: As soon as i reboot the 60 value is used.

I need to put a directive into the /etc/sysctl.d folder ?

To reply to my own question indeed it’s working now :

I created :

/etc/sysctl.d/swappiness.conf

And put the directive :

vm.swappiness=40

And it worked after the reboot! Oh Yeah :sunglasses:

I’m gonna keep testing different values.

Cheers

sysctl -p reads config from /etc/sysctl.conf as it is the default file. If you use another file simply do

sysctl -p /etc/sysctl.d/swappiness.conf

This is to avoid reboot after a config change.

Poke @mandian you rock !
I got it, that all makes sens now :slightly_smiling_face:
And thank you so much, I guess I got my skill up with sysctl :muscle:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.