Skip to content

Instantly share code, notes, and snippets.

@lintianzhi
Created May 15, 2014 09:15
Show Gist options
  • Save lintianzhi/733bcf631e5987a673d3 to your computer and use it in GitHub Desktop.
Save lintianzhi/733bcf631e5987a673d3 to your computer and use it in GitHub Desktop.
package main
import (
"runtime/debug"
"time"
)
func main() {
m := int64(1024*1024) * 100
for i := 1; i < 10; i++ {
test(m * int64(i))
}
debug.FreeOSMemory()
time.Sleep(time.Second * 100)
}
func test(n int64) {
b := make([]byte, n)
b[1] = 'a'
b[n-1] = 'z'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment