mirror of
https://github.com/golang/go
synced 2024-11-26 12:48:11 -07:00
runtime/debug: make TestFreeOSMemory repeatable
Fixes #4835. R=golang-dev, fullung CC=golang-dev https://golang.org/cl/7319050
This commit is contained in:
parent
8ecc4cb41e
commit
d62239b5f6
@ -71,11 +71,12 @@ func TestReadGCStats(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var big = make([]byte, 1<<20)
|
var big []byte
|
||||||
|
|
||||||
func TestFreeOSMemory(t *testing.T) {
|
func TestFreeOSMemory(t *testing.T) {
|
||||||
var ms1, ms2 runtime.MemStats
|
var ms1, ms2 runtime.MemStats
|
||||||
|
|
||||||
|
big = make([]byte, 1<<20)
|
||||||
big = nil
|
big = nil
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
runtime.ReadMemStats(&ms1)
|
runtime.ReadMemStats(&ms1)
|
||||||
|
Loading…
Reference in New Issue
Block a user