ktop icon indicating copy to clipboard operation
ktop copied to clipboard

Confusing the memory measurement units Gi and G

Open vincent-vinf opened this issue 11 months ago • 1 comments

When I was trying ktop I noticed that the amount of memory in the node looked larger than it actually was. You can see that most of the nodes have a total of 9Gi of memory when in reality they only have 7906356Ki (about 7.54 GiB). According to the discussion on stackoverflow, Ki, Gi are both powers of 2.

image image

I found the following code in ktop, which uses the ScaledValue function, which uses powers of 10 in that function, i.e. G, M, K.

https://github.com/vladimirvivien/ktop/blob/9ade4f20ee7a48f3c8ad871fb9db5a02519b65f5/views/overview/node_panel.go#L206-L207

  • ktop Version: v0.3.7
  • k8s Version: v1.21.14

vincent-vinf avatar Jan 15 '25 03:01 vincent-vinf

@vincent-vinf thanks for pointing this out. Will mark this as a bug so we can keep track.

vladimirvivien avatar Mar 11 '25 13:03 vladimirvivien

The latest pushes should have fixed this. Thanks.

vladimirvivien avatar Nov 24 '25 00:11 vladimirvivien