Kubernetes memory unit mistakes: 512m means half a byte, and 4G is not 4Gi

A test on a throwaway Kubernetes 1.37 cluster showed that memory quantities mixing decimal and binary suffixes behave differently than expected. Decimal units like G and M are smaller than their binary counterparts Gi and Mi, so a 4G limit leaves a JVM with noticeably less headroom than a 4Gi limit. Writing memory as 512m, which the API server accepts with only a warning, is interpreted as 0.512 bytes, and the pod can end up with no effective limit or hang in ContainerCreating. The author also found that a lowercase m in a node's memory column signals such a mistake, and that 2000m is silently stored as two bytes.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in