diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2024-05-30 09:40:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 09:40:34 +0200 |
commit | 27ca44ed2a63af4a82df15a19981cfd00cc53bd5 (patch) | |
tree | 6ddfcb4238805d211e0b88ff2b4a99987cec9d88 /client | |
parent | 60c53f17add31931e66da48f16e2e50113d65c68 (diff) | |
parent | fc66a28e9aba0bf995951c37c2e31db756de0934 (diff) |
Merge pull request #31348 from vespa-engine/jonmv/correctly-compute-with-node-tax
Account for node tax when computing heap mem pct
Diffstat (limited to 'client')
-rw-r--r-- | client/go/internal/admin/jvm/mem_options.go | 4 | ||||
-rw-r--r-- | client/go/internal/admin/jvm/mem_options_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/client/go/internal/admin/jvm/mem_options.go b/client/go/internal/admin/jvm/mem_options.go index d3b0d44c677..c78ee80dc80 100644 --- a/client/go/internal/admin/jvm/mem_options.go +++ b/client/go/internal/admin/jvm/mem_options.go @@ -55,8 +55,8 @@ func (opts *Options) MaybeAddHugepages(heapSize AmountOfMemory) { } func adjustAvailableMemory(measured AmountOfMemory) AmountOfMemory { - reserved := 1024 // MB - need_min := 64 // MB + reserved := 700 // MB -- keep in sync with com.yahoo.vespa.model.Host.memoryOverheadGb + need_min := 64 // MB available := measured.ToMB() if available > need_min+2*reserved { return MegaBytesOfMemory(available - reserved) diff --git a/client/go/internal/admin/jvm/mem_options_test.go b/client/go/internal/admin/jvm/mem_options_test.go index 3501e44c723..3db10153086 100644 --- a/client/go/internal/admin/jvm/mem_options_test.go +++ b/client/go/internal/admin/jvm/mem_options_test.go @@ -14,6 +14,6 @@ func TestAdjustment(t *testing.T) { assert.True(t, int(adj) >= lastAdj) lastAdj = int(adj) } - adj := adjustAvailableMemory(MegaBytesOfMemory(31024)).ToMB() + adj := adjustAvailableMemory(MegaBytesOfMemory(30700)).ToMB() assert.Equal(t, 30000, int(adj)) } |