Go language revises memory model

Go language revises memory model

Go 1.19, due in August, aligns the Go memory model with the memory model used by C, C++, Java, JavaScript, Rust, and Swift.

Credit: Google

Go 1.19, an update of the Google-developed programming language due in August, introduces a revised memory model and new types that make it easier to use atomic values. Now in a preview stage, Go 1.19 can be downloaded from The release is still considered unstable at this point.

With Go 1.19, the language’s memory model has been revised to align Go with the memory model used by C, C++, Java, JavaScript, and Swift, according to release notes. Go 1.19 also features new types in the sync/atomic package that make it easier to use atomic values such as atomic.int64 and atomic.Pointer(T).

The Go memory model specifies conditions under which reads of a variable in one goroutine can be guaranteed to observe values produced by writes to the same variable in a different goroutine. Go only provides sequentially consistent atomics, not any of more relaxed forms offered in other languages.

Go 1.19 also introduces a “small” change to the language, consisting of a correction to the scope of type parameters in method declarations. Existing programs are unaffected. Go 1.19 follows the momentous release in March of Go 1.18, which featured long-sought generics capabilities.

Specific to other new features and improvements in Go 1.19, the runtime now includes support for a soft memory limit. 

The limit includes the Go heap and other memory managed by the runtime and excludes external memory sources such as mappings of the binary, memory managed in other languages, and memory held by the OS on behalf of the Go program. Also, the runtime now schedules fewer GC worker routines on idle OS threads when the application is idle enough to force a periodic GC cycle.

Meanwhile, the compiler now uses a jump table to implement large integer and string switch statements. Performance improvements for the switch statement vary but can be on the order of 20 per cent faster.

In addition, the release supports links, lists, and clearer headings in doc comments plus the build constraint, unix, is now recognised in //go:build lines. Also, support is added for the Loongson 64-bit architecture LoongArch on Linux.

Follow Us

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags Google


EDGE 2023

EDGE is the leading technology conference for business leaders in Australia and New Zealand, built on the foundations of collaboration, education and advancement.


ARN has celebrated gender diversity and recognised female excellence across the Australian tech channel since first launching WIICTA in 2012, acknowledging the achievements of a talented group of female front runners who have become influential figures across the local industry.

ARN Innovation Awards 2023

Innovation Awards is the market-leading awards program for celebrating ecosystem innovation and excellence across the technology sector in Australia.

Brand Post

Channel Roadmap

The Channel Roadmap is a bespoke content hub housing strategic priorities from technology vendors for 2022 and beyond, partners can find the guidance on the key technologies and markets to pursue, to help build a blueprint for future success.

Show Comments