Bump up MinSystemMemory
to 6% of available_memory
.
PiperOrigin-RevId: 297689968 Change-Id: I4a6f3fbcc9c4dcc182d1c5b90f0b3e597e04e762
This commit is contained in:
parent
b396f0ed32
commit
70db082057
@ -805,17 +805,20 @@ int64 MinSystemMemory(int64 available_memory) {
|
||||
// We use the following heuristic for now:
|
||||
//
|
||||
// If the available_memory is < 2GiB, we allocate 225MiB to system memory.
|
||||
// Otherwise, allocate max(300MiB, 0.05 * available_memory) to system memory.
|
||||
// Otherwise, allocate max(300MiB, kMinSystemMemoryFraction *
|
||||
// available_memory) to system memory.
|
||||
//
|
||||
// In the future we could be more sophisticated by using a table of devices.
|
||||
int64 min_system_memory;
|
||||
constexpr float kMinSystemMemoryFraction = 0.06;
|
||||
if (available_memory < (1LL << 31)) {
|
||||
// 225MiB
|
||||
min_system_memory = 225 * 1024 * 1024;
|
||||
} else {
|
||||
// max(300 MiB, 0.05 * available_memory)
|
||||
min_system_memory =
|
||||
std::max(int64{314572800}, static_cast<int64>(available_memory * 0.05));
|
||||
// max(300 MiB, kMinSystemMemoryFraction * available_memory)
|
||||
min_system_memory = std::max(
|
||||
int64{314572800},
|
||||
static_cast<int64>(available_memory * kMinSystemMemoryFraction));
|
||||
}
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
// Do nothing
|
||||
|
Loading…
Reference in New Issue
Block a user