Blogs / What a Size Class Is, and Why 16 and 24 Bytes Are Common

What a Size Class Is, and Why 16 and 24 Bytes Are Common

What the Go team's post says a size class is, why some small sizes are the most common and what a Go programmer needs to do.

  • Learning
  • 1 min read

For: Learners curious about memory allocation.

Why some sizes are common

These allocations are some of the most common because they consist of two or three 64-bit values, so they include allocations for things such as interface values and strings which have two values, or slices which have three.[1]

Two or three 64-bitvalues16 and 24 byteallocationssome of the most commonsizes
What does the post say these allocations are made of?

What you need to do

While we hope this explanation of size-specialized allocation is interesting, you as a Go programmer don’t need to think about any of this when writing your code.[1]

Sources

  1. Size-Specialized Memory Allocation (go.dev · checked )

More articles