You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was looking through the meminfo parsing code and noticed that at here, the strings in /proc/meminfo are parsed as kilobytes:
Information::new::<information::kilobyte>(value)
However, as far as I understand it, it seems like this the wrong unit - this Red Hat doc states:
While the file shows kilobytes (kB; 1 kB equals 1000 B), it is actually kibibytes (KiB; 1 KiB equals 1024 B). This imprecision in /proc/meminfo is known, but is not corrected due to legacy concerns - programs rely on /proc/meminfo to specify size with the "kB" string.
So if I'm understanding this correctly, it's probably better to switch it to
Information::new::<information::kibibyte>(value)
as otherwise users may get values that are slightly inaccurate if they aren't aware.
The text was updated successfully, but these errors were encountered:
ClementTsang
changed the title
Linux memory usage parsing doesn't seem to be correct
Linux memory usage parsing seems to use the wrong unit
Jul 15, 2021
Was looking through the meminfo parsing code and noticed that at here, the strings in
/proc/meminfo
are parsed as kilobytes:However, as far as I understand it, it seems like this the wrong unit - this Red Hat doc states:
So if I'm understanding this correctly, it's probably better to switch it to
as otherwise users may get values that are slightly inaccurate if they aren't aware.
The text was updated successfully, but these errors were encountered: