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

Incorrect memory usage reported #14

Open
xxxserxxx opened this issue Feb 15, 2020 · 6 comments
Open

Incorrect memory usage reported #14

xxxserxxx opened this issue Feb 15, 2020 · 6 comments
Assignees
Labels
bug Something isn't working needs:review To determine inclusion or wont-fix os:freebsd
Milestone

Comments

@xxxserxxx
Copy link
Owner

xxxserxxx commented Feb 15, 2020

On FreeBSD, it shows 10.9 GB / 24 GB when the top utility shows

Mem: 3379M Active, 2029M Inact, 8809M Laundry, 7180M Wired, 1561M Buf, 2474M Free
ARC: 4001M Total, 3809M MFU, 168M MRU, 64K Anon, 12M Header, 13M Other
     3830M Compressed, 4002M Uncompressed, 1.04:1 Ratio
Swap: 4096M Total, 3073M Used, 1023M Free, 75% Inuse

Only 2.4 GB is free, but it shows that 24-10.9=13.1 GB is free.

You might also want to show all numbers, since you have space there.

@xxxserxxx xxxserxxx added bug Something isn't working os:freebsd labels Feb 15, 2020
@xxxserxxx
Copy link
Owner Author

So it's showing 10.8 GB / 24 GB but it should show like 21 GB / 24 GB? And this is just for the 'Main' memory and not Swap? And could you provide the output of uname -a? Thanks!

@xxxserxxx
Copy link
Owner Author

Yes, this is only for the Main memory.

$ uname -a
FreeBSD yv.noip.me 11.2-STABLE FreeBSD 11.2-STABLE #0 r338762M: Tue Sep 18 18:20:50 PDT 2018     unknown@nohost.com:/usr/obj/usr/src/sys/GENERIC  amd64

@xxxserxxx
Copy link
Owner Author

You might also want to show all numbers, since you have space there.

That would make more sense because only showing Free memory is not that interesting.

@xxxserxxx
Copy link
Owner Author

Showing all numbers would be more interesting, but the graph is only intended to show free memory and the label should probably reflect that imo.

@xxxserxxx
Copy link
Owner Author

xxxserxxx commented May 30, 2020

I'm not going to add memory stats to the widget, because FreeBSD reports memory stats like darwin reports thermal data: there are a million to choose from. However, I welcome a separate feature request -- separated from this bug report -- with suggestions for which memory metrics to report.

As for the bug itself, top on FreeBSD doesn't appear to accurately present the data either, compared against the information from vmstat. In any case, the information gotop's reporting is clearly wrong. Closest to a clean and concise report on FreeBSD aligning more or less with vmstat is colortop, so the objective of the bug fix is to get gotop's output to match those values for now.

Edit

top on FreeBSD (running in a VM) reports even more wildly inaccurate swap numbers, when compared with the authoritative swapinfo command. This makes me extra suspicious of using top for any baseline source of truth for bug reports.

@xxxserxxx
Copy link
Owner Author

xxxserxxx commented May 30, 2020

I'm taking this out for the moment. top's numbers are unreliable at best, and completely wrong in some cases. Swap information is the most clear type of memory information on FreeBSD, and top's numbers for Swap do not match any other system metric -- not swapinfo, not sysctl, and not any other tool. gopsutil (and, therefore, gotop) reports swap information matching system tool data closely.

I do have an open question about exactly which FreeBSD memory attribute best represents system physical system memory. gotop (through gopsutil) reports physical memory, and in testing these numbers closely match information reported by several other systems, including sysctl and freebsd-memory, and it reports numbers much closer to that reported by the kernel during boot-up (grep memory /var/run/dmesg.boot) than top's information. There are other attributes to use -- about 8, but up to a couple dozen (sysctl -s) -- and it isn't obvious that using hw.phys is incorrect.

While I won't close this, after spending a few hours investigating this, I'm not convinced this is a valid issue.

@xxxserxxx xxxserxxx added needs:review To determine inclusion or wont-fix and removed state:confirmed Reproduced labels May 30, 2020
@xxxserxxx xxxserxxx removed this from the v3.5.3 milestone May 30, 2020
@xxxserxxx xxxserxxx added this to the v4.0.2 milestone Jun 12, 2020
@xxxserxxx xxxserxxx modified the milestones: v4.0.2, v4.1.1 Aug 25, 2020
@xxxserxxx xxxserxxx modified the milestones: v4.1.1, v4.1.2 Jan 27, 2021
@xxxserxxx xxxserxxx modified the milestones: v4.1.2, v4.1.3 Jul 20, 2021
@xxxserxxx xxxserxxx modified the milestones: v4.1.3, v4.1.4 Feb 14, 2022
@xxxserxxx xxxserxxx modified the milestones: v4.1.4, v4.1.5 May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:review To determine inclusion or wont-fix os:freebsd
Projects
None yet
Development

No branches or pull requests

1 participant