Skip to content

Instantly share code, notes, and snippets.

@thomas11
Created June 11, 2012 09:52
Show Gist options
  • Select an option

  • Save thomas11/2909362 to your computer and use it in GitHub Desktop.

Select an option

Save thomas11/2909362 to your computer and use it in GitHub Desktop.

Revisions

  1. thomas11 created this gist Jun 11, 2012.
    15 changes: 15 additions & 0 deletions gistfile1.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    import (
    "runtime"
    "time"
    )

    ...

    go func() {
    for {
    var m runtime.MemStats
    runtime.ReadMemStats(&m)
    log.Printf("\nAlloc = %v\nTotalAlloc = %v\nSys = %v\nNumGC = %v\n\n", m.Alloc / 1024, m.TotalAlloc / 1024, m.Sys / 1024, m.NumGC)
    time.Sleep(5 * time.Second)
    }
    }()