Crashing - Due to Memory?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Crashing - Due to Memory?

Post by Ninpodeshi »

I often have multiple web browsers with multiple tabs open. My old laptop has 4 Gb RAM and never had a problem with this, but my new laptop, w/ 7.2 Gb RAM crashes once or twice a day. When this happens, the machine will slow to a snail's pace or freeze. There have been a couple of times, though, when I was able to open the System Monitor and kill processes to recover. System monitor will then show a huge drop in the Memory & Swap gauge, so this indicates to me that the problem is RAM not releasing memory. (Of course, I may be wrong.) PC info is below.

Is there a way to make the machine release its memory, so it doesn't freeze? I thought I saw an option somewhere to do this but cannot find it now.


-Computer-
Processor : AMD Ryzen 5 5600H with Radeon Graphics
Memory : 7523MB (4415MB used)
Machine Type : Notebook
Operating System : Linux Mint 21
User Name : asus (asus)
Date/Time : Wed 15 Feb 2023 05:47:49 PM +07
-Display-
Resolution : 1920x1080 pixels
OpenGL Renderer : RENOIR (renoir, LLVM 15.0.6, DRM 3.42, 5.15.0-58-generic)
X11 Vendor : The X.Org Foundation
-Audio Devices-
Audio Adapter : HDA-Intel - HD-Audio Generic
Audio Adapter : HDA-Intel - HD-Audio Generic
-Input Devices-
USB2.0 HD UVC WebCam: USB2.0 HD
ASUE1304:00 04F3:3201 Mouse
ASUE1304:00 04F3:3201 Touchpad
HD-Audio Generic HDMI/DP,pcm:3
HD-Audio Generic Headphone
Last edited by LockBot on Tue Aug 15, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kato181
Level 9
Level 9
Posts: 2577
Joined: Fri Mar 24, 2017 12:33 am
Location: Frederickton NSW

Re: Crashing - Due to Memory?

Post by kato181 »

You have told us nothing about the system you are using, in terminal copy & paste the following command and post the results back here in between the code display brackets 5th icon above the text box.

Code: Select all

inxi -Fxz
mikeflan
Level 17
Level 17
Posts: 7141
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Crashing - Due to Memory?

Post by mikeflan »

the problem is RAM not releasing memory.
The problem is probably one or more processes consuming RAM continuously.
Which processes are consuming your RAM?
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

kato181 wrote: Wed Feb 15, 2023 7:24 am You have told us nothing about the system you are using, in terminal copy & paste the following command and post the results back here in between the code display brackets 5th icon above the text box.

Code: Select all

inxi -Fxz
My apologies for not giving you sufficient information. I'm not sure what you mean by "5th icon above the text box," so I'm copying over the entire report for you. Thank you.


System:
Kernel: 5.15.0-58-generic x86_64 bits: 64 compiler: gcc v: 11.3.0
Desktop: Cinnamon 5.4.12 Distro: Linux Mint 21 Vanessa
base: Ubuntu 22.04 jammy
Machine:
Type: Laptop System: ASUSTeK product: VivoBook_ASUSLaptop M1503QA_M1503QA
v: 1.0 serial: <superuser required>
Mobo: ASUSTeK model: M1503QA v: 1.0 serial: <superuser required>
UEFI: American Megatrends LLC. v: M1503QA.301 date: 03/09/2022
Battery:
ID-1: BAT0 charge: 65.6 Wh (100.0%) condition: 65.6/70.0 Wh (93.6%)
volts: 11.9 min: 11.9 model: ASUSTeK ASUS Battery status: Not charging
CPU:
Info: 6-core model: AMD Ryzen 5 5600H with Radeon Graphics bits: 64
type: MT MCP arch: Zen 3 rev: 0 cache: L1: 384 KiB L2: 3 MiB L3: 16 MiB
Speed (MHz): avg: 1874 high: 2948 min/max: 400/4280 boost: enabled cores:
1: 1872 2: 2948 3: 1484 4: 2484 5: 1511 6: 1370 7: 2544 8: 1354 9: 1565
10: 1441 11: 2224 12: 1699 bogomips: 79050
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
Device-1: AMD Cezanne vendor: ASUSTeK driver: amdgpu v: kernel
bus-ID: 03:00.0
Device-2: IMC Networks USB2.0 HD UVC WebCam type: USB driver: uvcvideo
bus-ID: 3-3:3
Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu,ati
unloaded: fbdev,modesetting,vesa gpu: amdgpu resolution: 1920x1080~60Hz
OpenGL: renderer: RENOIR (renoir LLVM 15.0.6 DRM 3.42 5.15.0-58-generic)
v: 4.6 Mesa 22.2.5 direct render: Yes
Audio:
Device-1: AMD Renoir Radeon High Definition Audio driver: snd_hda_intel
v: kernel bus-ID: 03:00.1
Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor
vendor: ASUSTeK driver: N/A bus-ID: 03:00.5
Device-3: AMD Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel
v: kernel bus-ID: 03:00.6
Sound Server-1: ALSA v: k5.15.0-58-generic running: yes
Sound Server-2: PulseAudio v: 15.99.1 running: yes
Sound Server-3: PipeWire v: 0.3.48 running: yes
Network:
Device-1: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
vendor: AzureWave driver: mt7921e v: kernel bus-ID: 01:00.0
IF: wlp1s0 state: up mac: <filter>
Bluetooth:
Device-1: IMC Networks Wireless_Device type: USB driver: btusb v: 0.8
bus-ID: 3-2:2
Report: hciconfig ID: hci0 rfk-id: 2 state: down
bt-service: enabled,running rfk-block: hardware: no software: yes
address: <filter>
Drives:
Local Storage: total: 476.94 GiB used: 386.3 GiB (81.0%)
ID-1: /dev/nvme0n1 vendor: Micron model: 2210 MTFDHBA512QFD
size: 476.94 GiB temp: 40.9 C
Partition:
ID-1: / size: 467.89 GiB used: 386.29 GiB (82.6%) fs: ext4
dev: /dev/nvme0n1p2
ID-2: /boot/efi size: 511 MiB used: 5.2 MiB (1.0%) fs: vfat
dev: /dev/nvme0n1p1
Swap:
ID-1: swap-1 type: file size: 2 GiB used: 1.85 GiB (92.7%) file: /swapfile
Sensors:
System Temperatures: cpu: 52.0 C mobo: N/A gpu: amdgpu temp: 47.0 C
Fan Speeds (RPM): cpu: 1800
Info:
Processes: 361 Uptime: 22h 37m Memory: 7.17 GiB used: 4.63 GiB (64.5%)
Init: systemd runlevel: 5 Compilers: gcc: 11.3.0 Packages: 3029 Shell: Bash
v: 5.1.16 inxi: 3.3.13
User avatar
ricardogroetaers
Level 6
Level 6
Posts: 1374
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Crashing - Due to Memory?

Post by ricardogroetaers »

Ninpodeshi wrote: Wed Feb 15, 2023 10:42 pm
Drives:
Swap:
ID-1: swap-1 type: file size: 2 GiB used: 1.85 GiB (92.7%) file: /swapfile

Info:
Processes: 361 Uptime: 22h 37m Memory: 7.17 GiB used: 4.63 GiB (64.5%)
There is a memory eater in there.
The command below can show you the 25 most.
inxi -tm25
linux-rox
Level 10
Level 10
Posts: 3334
Joined: Sun Jul 19, 2020 9:17 pm

Re: Crashing - Due to Memory?

Post by linux-rox »

FWIW, I got an Asus laptop last summer and it's the worst computer I've ever had. Not having this problem, though.

Unlikely it's an issue with Mint. Have you tested the memory?
User avatar
kato181
Level 9
Level 9
Posts: 2577
Joined: Fri Mar 24, 2017 12:33 am
Location: Frederickton NSW

Re: Crashing - Due to Memory?

Post by kato181 »

I totally agree about Asus, they are junk, they have the highest power failures of any motherboard on their laptops. Usually it's the mosfets chips that are failing.They use cheap components and wonder why they fail. Their desktops mobo's are good I have one and it hasn't missed a beat and it's 5yrs old...Touch wood.
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

mikeflan wrote: Wed Feb 15, 2023 9:20 pm
the problem is RAM not releasing memory.
The problem is probably one or more processes consuming RAM continuously.
Which processes are consuming your RAM?
I am looking at the graph from the system monitor while it's running normally. When it freezes, it's usually too slow to access the system monitor and I have to restart, so I can't say what's using the memory when it crashes.

Chrome uses about 25% of the memory and Firefox, though it starts quite small, looks like it will eventually creep up to using about 50% of the memory.
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

So far, I've had a better experience with this Asus than the Acer I had before.

I had a friend with 20 years experience running Linux and doing web design help me with that install, and he had never seen anything so difficult. But Mint worked awesome on it -- until it gave me the Black Screen of Death. I didn't dare reinstall Linux after that. I am quite soured on Acer now, too, but maybe I was just unlucky?

Whatever is the cause, I hope you folks have a better time from here on out.
User avatar
kato181
Level 9
Level 9
Posts: 2577
Joined: Fri Mar 24, 2017 12:33 am
Location: Frederickton NSW

Re: Crashing - Due to Memory?

Post by kato181 »

I have an Acer Swift 3 and it's 3yrs old and have never had a problem with it..Again touch wood.
mikeflan
Level 17
Level 17
Posts: 7141
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Crashing - Due to Memory?

Post by mikeflan »

Chrome uses about 25% of the memory and Firefox, though it starts quite small, looks like it will eventually creep up to using about 50% of the memory.
Since you are crashing daily, it shouldn't be too much of an inconvenience to use Chrome for all browsing, and keep FF shutdown. Then maybe try the reverse - no chrome and FF for all browsing.

I am going to be surprised if FF is the problem. What plugins do you have? Tools - Add-ons and Themes. Mine are:
.
ff.png
.
I have 10+ FF windows going all the time and they take 1.4 GB memory, which is a lot.
ThaCrip
Level 5
Level 5
Posts: 988
Joined: Sat Dec 07, 2019 12:13 pm

Re: Crashing - Due to Memory?

Post by ThaCrip »

kato181 wrote: Thu Feb 16, 2023 1:11 am Their[ASUS] desktops mobo's are good I have one and it hasn't missed a beat and it's 5yrs old.
My primary PC's got a ASUS board and it's the longest I ever used a primary PC as in 3 months (so in May 2023) it will be 11 years old and it's running pretty much all of the time. it's on-board sound died in the year 2020 though, but I just disabled it in BIOS, then bought a cheap USB based sound card device with a 3.5mm jack as a quick fix.

my previous computer was a ASUS board to (used from March 2006 until May 2012 as primary PC, which is the 2nd longest I used a primary PC) and that's still working. but I replaced a good portion of the capacitors in it not all that long ago as a good portion of them were visibly swollen. but it was like that when I retired it in May 2012 and it still worked. but then revived the board for use in 2019 as I got a cheap quality PSU to get it going again as a backup computer and then a while later ordered some capacitors as the only ones visibly bad were all of the same type of which I just replaced all of that type as a precaution even though not all were visibly bad.
MainPC: i5-3550 (undervolted by -0.120v (CPU runs 12c cooler) /w stock i3-2120 hs/fan) | 1050 Ti 4GB | 16GB (2x 8GB) DDR3 1600Mhz RAM | Backups: AMD E-300 CPU (8GB RAM) / Athlon X2 3600+ CPU (@2.3GHz@1.35v) (4GB RAM) | All /w Mint 21.x-Xfce
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

ricardogroetaers wrote: Wed Feb 15, 2023 11:47 pm
Ninpodeshi wrote: Wed Feb 15, 2023 10:42 pm
Drives:
Swap:
ID-1: swap-1 type: file size: 2 GiB used: 1.85 GiB (92.7%) file: /swapfile

Info:
Processes: 361 Uptime: 22h 37m Memory: 7.17 GiB used: 4.63 GiB (64.5%)
There is a memory eater in there.
The command below can show you the 25 most.
inxi -tm25
The readout is below.

At the moment, I'm only running a few tabs of Chrome and a FF window with a couple dozen tabs.

I noticed that Chrome tends to use less memory, but the amount of memory used increases about the same when I open as it decreases when I close it. The amount of memory used seems to stay fairly constant (but, of course, will go up or down depending on how many tabs & windows I have open).

Firefox, on the other hand, tends to start out using only a small amount of memory, gradually increases, and continues to use the increased memory until I close it. Even if I go to FF & close several recently used tabs, it seems to have very little effect on the amount of memory used until closed & restarted.

I wonder if this problem might be solved by adjusting the swap memory allocation?


Memory top: 25 of 372
1: mem: 469.3 MiB (6.3%) command: firefox pid: 77431
2: mem: 355.1 MiB (4.8%) command: firefox-bin pid: 112268
3: mem: 267.6 MiB (3.6%) command: chrome pid: 88867
4: mem: 244.3 MiB (3.3%) command: firefox-bin pid: 112042
5: mem: 240.9 MiB (3.2%) command: chrome pid: 122361
6: mem: 217.7 MiB (2.9%) command: firefox-bin pid: 124419
7: mem: 196.5 MiB (2.6%) command: firefox-bin pid: 115072
8: mem: 192.5 MiB (2.6%) command: firefox-bin pid: 124576
9: mem: 187.4 MiB (2.5%) command: chrome pid: 122491
10: mem: 183.4 MiB (2.4%) command: chrome pid: 89223
11: mem: 181.7 MiB (2.4%) command: firefox-bin pid: 116446
12: mem: 179.2 MiB (2.4%) command: firefox-bin pid: 77723
13: mem: 169.6 MiB (2.3%) command: chrome pid: 89274
14: mem: 169.2 MiB (2.3%) command: firefox-bin pid: 117317
15: mem: 169.1 MiB (2.3%) command: chrome pid: 89562
16: mem: 168.7 MiB (2.2%) command: chrome pid: 122347
17: mem: 166.1 MiB (2.2%) command: cinnamon pid: 1595
18: mem: 140.7 MiB (1.9%) command: firefox-bin pid: 124363
19: mem: 129.7 MiB (1.7%) command: chrome pid: 89273
20: mem: 128.8 MiB (1.7%) command: firefox-bin pid: 116644
21: mem: 124.1 MiB (1.6%) command: chrome pid: 88910
22: mem: 119.0 MiB (1.6%) command: firefox-bin pid: 116573
23: mem: 113.2 MiB (1.5%) command: firefox-bin pid: 116534
24: mem: 103.8 MiB (1.4%) command: chrome pid: 122527
25: mem: 101.7 MiB (1.3%) command: firefox-bin pid: 116491
Dullard du Jour
Level 5
Level 5
Posts: 519
Joined: Fri Dec 23, 2022 10:43 am

Re: Crashing - Due to Memory?

Post by Dullard du Jour »

I am too lazy to type the 'meat' of the the below link but here are some hints about FF memory usage. :)


Control FF Memory Usage

Mozilla Suggestions

ItsFoss Suggestions
User avatar
ricardogroetaers
Level 6
Level 6
Posts: 1374
Joined: Sat Oct 27, 2018 3:06 am
Location: Rio de Janeiro, Brasil

Re: Crashing - Due to Memory?

Post by ricardogroetaers »

Ninpodeshi wrote: Wed Feb 22, 2023 8:09 am At the moment, I'm only running a few tabs of Chrome and a FF window with a couple dozen tabs.

I noticed that Chrome tends to use less memory, but the amount of memory used increases about the same when I open as it decreases when I close it. The amount of memory used seems to stay fairly constant (but, of course, will go up or down depending on how many tabs & windows I have open).

Firefox, on the other hand, tends to start out using only a small amount of memory, gradually increases, and continues to use the increased memory until I close it. Even if I go to FF & close several recently used tabs, it seems to have very little effect on the amount of memory used until closed & restarted.

I wonder if this problem might be solved by adjusting the swap memory allocation?
Chrome (default setting) currently frees memory from inactive tabs, and activates them again when you return to them. This saves memory.
I don't know if Firefox contemplates this feature.

The 25 processes shown in the inxi command already take 63% of memory, not counting the processes that are not shown.
From grain to grain the hen fills her stomach.

Swapping is on the HD or SSD, which are much slower than ram memory.
Would this be a solution? I don't know.

Did the "old" machine run the same operating system? Did it have the same kernel? The kernels of the 5.15 series are very buggy.

Translated with www.DeepL.com/Translator (free version)
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

Lou77 wrote: Wed Feb 22, 2023 11:45 am I am too lazy to type the 'meat' of the the below link but here are some hints about FF memory usage. :)


Control FF Memory Usage

Mozilla Suggestions

ItsFoss Suggestions
Thank you, Lou77, for the suggestions. They are appreciated. When my laptop crashes, it normally slows to a crawl and freezes quite suddenly. This normally prevents me from being able to open the memory usage tab on FF, but I thank you for teaching me about it. It will likely be useful in the future.

Since my last post, I've seen that my machine will crash whether using only FF or only Chrome also. So, this tells me that the solution must likely be something that deals with Linux as a system and not just FF.

The "Control FF Memory Usage" link you gave me might have an answer. Under section 1. "Enable cgroups v2 and swap control," does that command work system wide, or would it only work on FF? (It looks like it should be an overal system setting, but I'm not sure.)
,
Altrenatively, do you have a suggestion for how to make Linux free up memory instead? Or, could you offer the correct keywords I need to search for an answer to this problem?
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

ricardogroetaers wrote: Sun Mar 05, 2023 4:01 pm
Ninpodeshi wrote: Wed Feb 22, 2023 8:09 am At the moment, I'm only running a few tabs of Chrome and a FF window with a couple dozen tabs.

I noticed that Chrome tends to use less memory, but the amount of memory used increases about the same when I open as it decreases when I close it. The amount of memory used seems to stay fairly constant (but, of course, will go up or down depending on how many tabs & windows I have open).

Firefox, on the other hand, tends to start out using only a small amount of memory, gradually increases, and continues to use the increased memory until I close it. Even if I go to FF & close several recently used tabs, it seems to have very little effect on the amount of memory used until closed & restarted.

I wonder if this problem might be solved by adjusting the swap memory allocation?
Chrome (default setting) currently frees memory from inactive tabs, and activates them again when you return to them. This saves memory.
I don't know if Firefox contemplates this feature.

The 25 processes shown in the inxi command already take 63% of memory, not counting the processes that are not shown.
From grain to grain the hen fills her stomach.

Swapping is on the HD or SSD, which are much slower than ram memory.
Would this be a solution? I don't know.

Did the "old" machine run the same operating system? Did it have the same kernel? The kernels of the 5.15 series are very buggy.

Translated with www.DeepL.com/Translator (free version)
Thank you for the reply, Ricardogroetaers.

The old machine ran Widows 10. I had Linux Mint on it for a few months, but had an awful time installing. (Some BIOS issue that I don't understand.) Then it had a hard crash (data loss & unable to start) & didn't feel safe using Linux on that machine again.

I'm not sure how to change swapping from HD/SSD to RAM?

As I noted above, since my last post, I've had crashes while running each browser alone. Is there a way to tell Linux to release memory system wide? I'd appreciate any advice.
User avatar
Koentje
Level 7
Level 7
Posts: 1578
Joined: Tue Jan 04, 2022 6:23 pm
Location: Netherlands

Re: Crashing - Due to Memory?

Post by Koentje »

I had the same problem with Mint 19 on my previous system. Firefox eating up all my memory! I wrote a small script that kept track of firefox memory usage..

Copy this into a bash file and name it memusage:

Code: Select all

#!/bin/sh
cmd=$1
 if [ "$cmd" = "" ]; then
   echo -e "\n memusage <program name> \n"
 else
   sudo inxi -tm1000 | grep $cmd | awk '{sum+=$3} {print sum}' | tail -n1
 fi
Open a terminal window and run the following command:
watch -d memusage firefox

(or any other program name you suspect of eating up your memory)
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

After more observation, I can see that it is not a single program that is crashing the machine. It has crashed with only Chrome, only Firefox, and once with neither web browser running. That tells me this is probably something system wide.

Once in a while, if I have the System Monitor open, I can go to it and kill enough processes to recover without a restart. So, this indicates that the problem has something to do with memory not being able to release.

How do I make the memory release so I don't crash all the time?
Ninpodeshi
Level 1
Level 1
Posts: 35
Joined: Fri Mar 08, 2019 4:56 am

Re: Crashing - Due to Memory?

Post by Ninpodeshi »

I solved it.

The problem was due to having too little swap memory. I followed the guide below and increased swap memory from 2Gb to 8Gb (to match my machine's memory. I've ran more intensive apps concurrently since then to test it, and the worst that's happened is a temporary slowdown. (I might go back in and increase the swap later to resolve that.)

A big thank you to everyone who jumped in with suggestions.

https://www.fosslinux.com/1064/how-to-c ... x-mint.htm
Locked

Return to “Beginner Questions”