Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate Memory Usage Reporting Due to Not Considering MemAvailable #29

Open
NERLOE opened this issue Mar 24, 2024 · 1 comment
Open

Comments

@NERLOE
Copy link

NERLOE commented Mar 24, 2024

Environment

  • pgAdmin Version: 8.4
  • System Stats Extension Version: 2.1
  • OS: Ubuntu 22.04
  • Browser: Google Chrome

Description:

The system_stats extension seems to be reporting used memory by subtracting the 'MemFree' value from the 'MemTotal' value in /proc/meminfo. However, this does not account for the 'MemAvailable' value, which provides a more realistic figure of how much memory is truly available for new processes, as it includes cached and buffered memory that can be reallocated.

Steps to Reproduce:

  1. Open pgAdmin's dashboard to view system statistics.
  2. Compare the memory usage reported by pgAdmin with the output of cat /proc/meminfo in the terminal.

Expected behavior:

The memory usage reported by the system_stats extension should consider 'MemAvailable' to provide an accurate representation of how much memory is available for new processes, without causing swapping.

Current behavior:

The system_stats extension reports memory usage based on 'MemTotal' minus 'MemFree', leading to a potential misunderstanding of the actual available memory, especially in scenarios where a significant portion of the memory is used for caches and buffers but can be made available.

Possible Fix:

Modify the memory usage calculation in the system_stats extension to take 'MemAvailable' into account when computing available memory. This would align the reported memory usage with modern Linux memory reporting standards.

Additional context:

Here is a sample output from /proc/meminfo:

MemTotal: 131569360 kB
MemFree: 724984 kB
MemAvailable: 123998908 kB

In this example it says 124GB memory used and 802MB free, even tho it's actually only around 7.6GB used and around 123GB available (as seen in the output from /proc/meminfo/):

@sain801028
Copy link

me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants