LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-29-2019, 05:24 PM   #1
CPT-GrayWolf
LQ Newbie
 
Registered: Sep 2019
Location: Colorado USA
Distribution: Fedora
Posts: 14

Rep: Reputation: Disabled
Question Memory Consumed By The Void


Before someone links me to linuxaremyram.com after reading the first line. My buffer/cache usage is negligible. Continue reading.

Something on my desktop system is causing my memory usage to slowly climb until it becomes unusable.

Here's where things start to get odd though.
If you make a rough sum of the resident memory of userland applications, it comes to about 5-6GB (That is, unfortunately, normal, as firefox alone consumes 2-3GB.).

However, if I leave my system up for about 6-8 hours, something I do regularly as restarting is a pain for me, the memory usage goes from evening out at around 6GB to about 8-9GB. That's a 2-3GB discrepancy from the memory usage reported in userland. I would expect to see some disparity between these numbers, there's the kernel, and they're not entirely accurate, but that's not a negligible difference.
I can clear the kernel caches, it makes no difference. The available memory will continue to drop at an increasing rate until the system becomes unuable.

After 24 hours the discrepancy increases to 6-7GB and the system swapping starts to slow things down. The sum of userland memory remains at 5-6GB while the available memory has dropper to only a couple GB.

slabtop reports memory usage around 500MB, so it's not that.
My memory appears to just be consumed by some boundless abyss.
I don't even know where to look to diagnose this.

The commands I used are:
Code:
Sum of resident memory:

echo $(( $(top -b -o RES -n 1 | tail -n +8 | awk '{ print $6 }' | awk '{ s+=$1 } END { print s }') / 1024 ))MB

Used memory:

echo $(( $(free | head -n 2 | tail -n 1 | awk '{ print $3 }') / 1024 ))MB
Discrepancy is calculated as the difference between the two.
The caches where cleared using:
Code:
echo 3 > /proc/sys/vm/drop_caches
I'm running Fedora 30 with the latest updates, the issue started after a recent update.
I wonder if the issue is related to the kernel 5.3.7 update, but even if it is, the improvements in the newer kernel make it difficult for me to go back.

Where do I go with this. I'm losing my mind!
How can I diagnose memory usage that I can't see?
 
Old 10-29-2019, 06:47 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Diff /proc/meminfo across one of the periods of concern. If you have reasonable awk skills you can toss the small changes away or simply reverse sort and head. Then you'll have an idea where the growth is.
Rather than messing like that go get ps_mem - it's in the Fedora repos IIRC - and diff that too. Then hopefully you'll have something we can work with.
 
Old 10-29-2019, 07:10 PM   #3
CPT-GrayWolf
LQ Newbie
 
Registered: Sep 2019
Location: Colorado USA
Distribution: Fedora
Posts: 14

Original Poster
Rep: Reputation: Disabled
Alright.

I needed to reboot anyway, so I'm testing an older kernel right now. It seems fine, but I won't know for sure for at least a few more hours.

Still having a place to start is good. Perhaps if I wrote a script to graph changes to '/proc/meminfo' over time?
I don't know how much ps_mem will help. As I said, the memory used by userland applications seemed only to change negligibly after a couple hours, and even restarting the worst offenders only freed, at most, a Gig or two. Maybe it'll reveal something I missed though.
 
Old 10-29-2019, 07:18 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Keep an eye on the huge page numbers ...
 
Old 10-29-2019, 07:24 PM   #5
CPT-GrayWolf
LQ Newbie
 
Registered: Sep 2019
Location: Colorado USA
Distribution: Fedora
Posts: 14

Original Poster
Rep: Reputation: Disabled
I don't think I even have hugepages enabled.

I'm not sure how much of a benefit it would be to me in most situations.
 
Old 10-30-2019, 11:21 AM   #6
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,174

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Firefox has an option unload memory from tabs that are inactive, assuming you are leaving it running with a few tabs open. It will take a few seconds to reload the page when you click on it, but may be worth the wait if the rest of the system runs smoother.

about:config and search for browser.tabs.unloadOnLowMemory and change the value from false to true.
 
Old 10-31-2019, 12:50 AM   #7
CPT-GrayWolf
LQ Newbie
 
Registered: Sep 2019
Location: Colorado USA
Distribution: Fedora
Posts: 14

Original Poster
Rep: Reputation: Disabled
Okay. The older kernel showed no issues, so whatever is going on is somehow related to the newer kernel.

I've rebooted back into the new kernel and scheduled a job to log the output of '/proc/meminfo' ever ten minutes.
Assuming the system becomes unusable again, I'll return to the old kernel and analyse the files from there.

Although with my luck, it might suddenly decide to work normally after I changed nothing.
 
Old 10-31-2019, 01:55 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Another approach would be to look around if other people with the same distro/kernel/DE combo have experienced sth similar.
In your case, fedora forums I guess?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Void Linux is... void black-clover Linux - Networking 8 11-23-2017 08:04 PM
pthread giving error: invalid conversion from ‘void* (*)(int*)’ to ‘void* (*)(void*)’ knobby67 Programming 4 05-05-2017 10:54 AM
(void)time(&cur_time); Why did the author put (void) here? e3399 Programming 3 03-28-2011 11:45 AM
void main(void) linuxanswer Programming 4 10-26-2003 12:37 AM
void foo(void) and void foo() lackluster Programming 9 02-15-2003 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration