blob: 3db10153086318b1fb1d918a83720aa4597b1022 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package jvm
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAdjustment(t *testing.T) {
lastAdj := 64
for i := 0; i < 4096; i++ {
adj := adjustAvailableMemory(MegaBytesOfMemory(i)).ToMB()
assert.True(t, int(adj) >= lastAdj)
lastAdj = int(adj)
}
adj := adjustAvailableMemory(MegaBytesOfMemory(30700)).ToMB()
assert.Equal(t, 30000, int(adj))
}
|