Skip to content

[SUGGESTION] Memory usage & Total Memory #13

@DrunkenAlcoholic

Description

@DrunkenAlcoholic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions