node-os-utils icon indicating copy to clipboard operation
node-os-utils copied to clipboard

osu.mem.info() totalMemMb is actually MiB

Open connerdassen opened this issue 4 years ago • 3 comments

The function from the title is called .totalMemMb, which suggests a return value in megabit. I found the actual return value to be in MiB, (mebibytes) (Mb = megabit, MB = megabyte, MiB = mebibyte, there's a difference!)

Therefore I think the function name should be changed to .totalMemMib.

connerdassen avatar Dec 17 '20 19:12 connerdassen

@kontenbonker

The difference is small。 Although there are differences, I think you can ignore difference。 Do you think?

SunilWang avatar Dec 18 '20 03:12 SunilWang

Actually, since Mb is megabit, the difference is quite a lot. On my server with 64GB ram, the return value of the function is 65365,1484375, which is the amount of MiB. If it were actually in Mb like the name suggests, the amount should be 574957,9260666838. That's about 8.8 times more.

connerdassen avatar Dec 18 '20 09:12 connerdassen

@kontenbonker Can you provide the Mb algorithm, commit a Pull requests?

SunilWang avatar Dec 18 '20 09:12 SunilWang