skip to content
Alvin Lucillo

Memstats Alloc

/ 1 min read

💻 Tech

Go’s runtime package allows us to check metrics such as memory. For example, Alloc below shows the current memory usage of heap objects.

	var m runtime.MemStats
	runtime.ReadMemStats(&m)

	fmt.Printf("%v", m.Alloc)