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

[SUGGESTION] Memory usage & Total Memory #13

Open
DrunkenAlcoholic opened this issue Mar 3, 2022 · 0 comments
Open

[SUGGESTION] Memory usage & Total Memory #13

DrunkenAlcoholic opened this issue Mar 3, 2022 · 0 comments

Comments

@DrunkenAlcoholic
Copy link

First I would like to say treefetch is an excellent fetch program, but it has an issue with the displayed memory usage and total memory.

I did a little research on htop to see how they are calculating it. I have actually done this my self in the Pascal language by using the /proc/meminfo, assuming you are familiar with the /proc/meminfo fields.

Total physical memory = MemTotal
Memory Used = (MemTotal + Shmem) - MemFree - Buffers - Cached - SReclaimable

these as you know are in kb, its just a matter of

  • Total phsical memory / (1024 * 1024)
  • Memory Used / (1024 * 1024)

or instead of using (1024*1024) just divide by the sum which is 1048576, this will yeild GB format as you already know.

Anyway I just thought to show you the calculation used by htop and btop ect... to get used memory, as your current implementation is is not adding up to the more common program memory usage programs out there.

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

1 participant