Bug 512776

Summary: Incorrect free memory reported by system widget
Product: [Frameworks and Libraries] ksystemstats Reporter: Arun Chandrasekaran <visionofarun>
Component: GeneralAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: ahiemstra, nate, notmart, visionofarun
Priority: NOR    
Version First Reported In: 6.4.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Comparison of free memory reported by plasma widget vs what's reported by the kernel proc filesystem.

Description Arun Chandrasekaran 2025-11-30 01:35:20 UTC
SUMMARY

Incorrect free memory reported by system memory widget

STEPS TO REPRODUCE

1. Add a memory usage widget
2. Enable free memory display with line graph
3. Watch the free memory

OBSERVED RESULT

Comparing the free memory reported by the widget with the output of `free -k` or its equivalent `/proc/meminfo` is intriguing. Free memory shown by the system widget is not matching with what the kernel reports in the proc file system or free -k. 

The widget shows much higher value being free and does not negate the cached memory from free memory.

EXPECTED RESULT

The system widget shall report the memory metrics from /proc/meminfo accurately.

SOFTWARE/OS VERSIONS

$ kinfo
Operating System: Kubuntu 25.10
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2
Kernel Version: 6.17.0-7-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ Ultra 7 258V
Memory: 32 GiB of RAM (30.8 GiB usable)
Graphics Processor: Intel® Graphics

ADDITIONAL INFORMATION
Comment 1 Arun Chandrasekaran 2025-11-30 01:45:18 UTC
Created attachment 187258 [details]
Comparison of free memory reported by plasma widget vs what's reported by the kernel proc filesystem.

Comparison of free memory reported by plasma widget vs what's reported by the kernel proc filesystem.
Comment 2 Nate Graham 2025-12-11 17:30:33 UTC
I'm afraid these numbers will never match up because they're using different methods of calculating memory. It turns out that there is no objectively correct way of measuring memory usage; it depends quite a bit on the assumptions you make about what "free" and "used" mean. Different tools make different assumptions based on what makes sense for their own uses, and hence will return slightly different numbers.