LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Memory Consumed By The Void (https://www.linuxquestions.org/questions/linux-desktop-74/memory-consumed-by-the-void-4175663376/)

CPT-GrayWolf 10-29-2019 05:24 PM

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?

syg00 10-29-2019 06:47 PM

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.

CPT-GrayWolf 10-29-2019 07:10 PM

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.

syg00 10-29-2019 07:18 PM

Keep an eye on the huge page numbers ...

CPT-GrayWolf 10-29-2019 07:24 PM

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.

uteck 10-30-2019 11:21 AM

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.

CPT-GrayWolf 10-31-2019 12:50 AM

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.

ondoho 10-31-2019 01:55 AM

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?


All times are GMT -5. The time now is 04:34 PM.