------------------------------ As noted in the Go size classes table (source <https://github.com/golang/go/blob/go1.24.0/src/runtime/sizeclasses.go#L58>), size class 52 corresponds to objects of 9472 bytes each. Go allocates 7 pages (7 × 8192 = 57344 bytes) for a span of this size class, which fits 6 objects, leaving a tail waste of 512 bytes.
Why doesn’t Go allocate 37 pages for this size class instead? That would provide exactly 303104 bytes (37 × 8192), which fits exactly 32 objects of 9472 bytes with no waste. Wouldn't this be a more efficient use of memory? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/b2b8b688-c71f-4e5e-bbca-d819389b10e1n%40googlegroups.com.