aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2018-10-01 19:58:01 +0000
committerMichael Knyszek <mknyszek@google.com>2018-10-30 15:44:23 +0000
commit7836457ec3cc128efd9dd54197e8e5c25408c8b0 (patch)
treef2e81908013abba9d877c3aeb50857bff206ecef /src/runtime/malloc_test.go
parentc803ffc67d0c90b24eb5a60a7d573eecc39e7753 (diff)
downloadgo-7836457ec3cc128efd9dd54197e8e5c25408c8b0.tar.xz
runtime: add physical memory scavenging test
This change introduces a test to malloc_test which checks for overuse of physical memory in the large object treap. Due to fragmentation, there may be many pages of physical memory that are sitting unused in large-object space. For #14045. Change-Id: I3722468f45063b11246dde6301c7ad02ae34be55 Reviewed-on: https://go-review.googlesource.com/c/138918 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/malloc_test.go')
-rw-r--r--src/runtime/malloc_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/malloc_test.go b/src/runtime/malloc_test.go
index e6afc25ea9..f25bfa48af 100644
--- a/src/runtime/malloc_test.go
+++ b/src/runtime/malloc_test.go
@@ -168,6 +168,14 @@ func TestTinyAlloc(t *testing.T) {
}
}
+func TestPhysicalMemoryUtilization(t *testing.T) {
+ got := runTestProg(t, "testprog", "GCPhys")
+ want := "OK\n"
+ if got != want {
+ t.Fatalf("expected %q, but got %q", want, got)
+ }
+}
+
type acLink struct {
x [1 << 20]byte
}