Created
April 8, 2011 00:17
-
-
Save davecheney/909061 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ( | |
"runtime" | |
"fmt" | |
"time" | |
) | |
func stats() { | |
for { | |
<-time.After(3e9) | |
fmt.Printf("CurrAlloc: %d, HeapAlloc: %d\n", runtime.MemStats.Alloc, runtime.MemStats.HeapAlloc) | |
} | |
} | |
func main() { | |
go stats() | |
for { | |
<-time.After(7e9) | |
runtime.GC() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment