Skip to content

Instantly share code, notes, and snippets.

@fvbock
Last active August 29, 2015 13:56
Show Gist options
  • Save fvbock/9265017 to your computer and use it in GitHub Desktop.
Save fvbock/9265017 to your computer and use it in GitHub Desktop.
func printMemStats() {
memstats := new(runtime.MemStats)
runtime.ReadMemStats(memstats)
s.Log.Printf("memstats before GC: bytes = %d footprint = %d mallocs = %d frees = %d",
memstats.HeapAlloc, memstats.Sys, memstats.Mallocs, memstats.Frees)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment