aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/heapsampling.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/heapsampling.go b/test/heapsampling.go
index ed9208c1f4..c00b866680 100644
--- a/test/heapsampling.go
+++ b/test/heapsampling.go
@@ -92,6 +92,9 @@ func checkValue(fname string, ln int, name string, want, got int64) {
func getMemProfileRecords() []runtime.MemProfileRecord {
// Force the runtime to update the object and byte counts.
+ // This can take up to two GC cycles to get a complete
+ // snapshot of the current point in time.
+ runtime.GC()
runtime.GC()
// Find out how many records there are (MemProfile(nil, true)),