diff options
author | jonmv <venstad@gmail.com> | 2024-05-29 22:17:59 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2024-05-29 22:17:59 +0200 |
commit | e25cd69faff357151fd5efcf5dfba8790e13437f (patch) | |
tree | 94ae2b88474d1103f50b2f625647b8d9b52ff675 /client | |
parent | e0eef8d7aad00384ab192e27d7a3d39303d87de7 (diff) |
Correctly account for node memory overhead when computing args for startup script
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)) } |