Created
November 9, 2015 15:32
-
-
Save j16r/52060542b1a97bdb2dda to your computer and use it in GitHub Desktop.
Go allows for reading the VM's memory statistics, neat!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"runtime" | |
) | |
func main() { | |
s := new(runtime.MemStats) | |
runtime.ReadMemStats(s) | |
fmt.Println("Alloc : ", s.Alloc) | |
fmt.Println("Total Alloc : ", s.TotalAlloc) | |
fmt.Println("Sys : ", s.Sys) | |
fmt.Println("Lookups : ", s.Lookups) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment