Bug 496654 - Memory Leak? System monitor reports memory used, but not the process(es) at fault.
Summary: Memory Leak? System monitor reports memory used, but not the process(es) at f...
Status: RESOLVED NOT A BUG
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 496653 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-11-25 01:20 UTC by xenothestrange
Modified: 2025-03-23 23:14 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Memory usage while apparent leak was occuring (after waking from sleep) (12.34 KB, text/plain)
2024-12-19 21:41 UTC, xenothestrange
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xenothestrange 2024-11-25 01:20:25 UTC
STEPS TO REPRODUCE
Unclear. I noticed this issue after the following:
1. Accidentally opening a 70gb PDF using KWrite (it was a .txt file for some reason). I had to kill the program with system monitor.
2. running multiple virtual machines under KVM/QEMU

OBSERVED RESULT
Over 10GB of system memory is being used.... but System Monitor has no idea what it is, and neither do I

EXPECTED RESULT
Memory is not in use when programs are closed and/or System Monitor sees what program(s) are using up all the memory.


SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0

ADDITIONAL INFORMATION
Memory: 15.6 GiB of RAM
Image of running processes using `top`: https://imgur.com/a/iBofbfG

I'm honestly just kind of baffled and I've had this issue multiple times recently and had to reboot to fix it.
I'm not sure what the cause could be because I (barely) remember doing various different tasks. It could be KWrite, that is a common denominator but wouldn't make much sense.....
Comment 1 Arjen Hiemstra 2024-11-25 11:47:30 UTC
It sounds like you might be running into some kind of kernel memory leak. You'll want to start with looking at `/proc/meminfo`, which is the file we use for reading global memory info. "Free" memory is the "MemAvailable" field in this file, while "Used" is calculated as "MemTotal - MemAvailable".

There are a bunch more fields in that file that may be relevant for your specific issue. For example, "Slab", "SReclaimable" and "SUnreclaim" indicate total memory allocated by the kernel's Slab allocator and how much of that can be reclaimed and how much can't be reclaimed. The Slab allocated memory is memory that is not available to applications, so it is not listed in the process view.
Comment 2 Nate Graham 2024-11-25 20:37:15 UTC
.
Comment 3 Bug Janitor Service 2024-12-10 03:46:37 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 4 xenothestrange 2024-12-19 18:59:14 UTC
(In reply to Arjen Hiemstra from comment #1)
> It sounds like you might be running into some kind of kernel memory leak.
> You'll want to start with looking at `/proc/meminfo`, which is the file we
> use for reading global memory info. "Free" memory is the "MemAvailable"
> field in this file, while "Used" is calculated as "MemTotal - MemAvailable".
> 
> There are a bunch more fields in that file that may be relevant for your
> specific issue. For example, "Slab", "SReclaimable" and "SUnreclaim"
> indicate total memory allocated by the kernel's Slab allocator and how much
> of that can be reclaimed and how much can't be reclaimed. The Slab allocated
> memory is memory that is not available to applications, so it is not listed
> in the process view.

Noted. Update: It happens when I wake the computer from sleep. I logged in to see that I had 8/16gb used up and immediately went "Oh no" and restarted the computer before it could crash.
I saw the updates in this thread when I checked my email.

Maybe there's some script I could slap together to log some data when I notice it happening? It's pretty fast.
I could just output that command to a file to see where the memory was allocated. I'm not sure how helpful that will be necessarily (?)
Comment 5 xenothestrange 2024-12-19 19:00:06 UTC
Note: I watched the memory usage slowly tick up as I sat on the desktop, before I decided to restart.
Comment 6 xenothestrange 2024-12-19 19:10:39 UTC
#!/bin/bash
date >> gonnacrash.txt
cat /proc/meminfo >> gonnacrash.txt
echo " " >> gonnacrash.txt

🤷🏻‍♂️
Comment 7 xenothestrange 2024-12-19 21:41:51 UTC
Created attachment 176775 [details]
Memory usage while apparent leak was occuring (after waking from sleep)

Memory rapidly filling up for unknown reasons after waking from sleep.
It didn't crash this time, after it got up to like 8gb used it reset down to 2gb and stopped filling up.
Comment 8 TraceyC 2024-12-19 22:07:18 UTC
*** Bug 496653 has been marked as a duplicate of this bug. ***
Comment 9 Arjen Hiemstra 2025-03-18 10:03:56 UTC
There is nothing for us to do here, so I'm closing this.
Comment 10 xenothestrange 2025-03-23 23:14:59 UTC
(In reply to Arjen Hiemstra from comment #9)
> There is nothing for us to do here, so I'm closing this.

Ok, go for it. I'm not sure what even caused this issue, but I haven't had a problem with it for some time now, It was probably passively fixed in an update, I imagine.