Fail to deploy elastic pu due to incorrect memory calculation

Description

Linux7 machine with slab fail to allocate pu since the slab memory is not taken into account.

Exception:
2019-11-07 15:27:14,136 ESM WARNING [org.openspaces.grid.gsm.strategy.ScaleStrategyProgressEventState] - [csc-3.5.0.0.911201] Failed to start container on machine.poddub-ws1-bkp-cl1-01.pod-fx.emea.dell.com/10.27.30.59. Caused By:Machine poddub-ws1-bkp-cl1-01.pod-fx.emea.dell.com/10.27.30.59 free memory 1695MB is not enough to start a container with 1800MB. Free machine memory or increase machine provisioning reservedMemoryPerMachine property.; Caused by: org.openspaces.grid.gsm.containers.exceptions.FailedToStartNewGridServiceContainersException: Failed to start container on machine.poddub-ws1-bkp-cl1-01.pod-fx.emea.dell.com/10.27.30.59. Caused By:Machine poddub-ws1-bkp-cl1-01.pod-fx.emea.dell.com/10.27.30.59 free memory 1695MB is not enough to start a container with 1800MB. Free machine memory or increase machine provisioning reservedMemoryPerMachine property.

Following are the output from OSHI, SIGA, and Linux 'free':

>>>> java -cp ./lib/jackson-annotations-2.9.10.jar:./lib/jackson-databind-2.9.10.1.jar:./lib/jna-platform-5.5.0.jar:./lib/jackson-core-2.9.10.jar:./lib/jna-5.5.0.jar:./lib/slf4j-api-1.7.29.jar:$PWD/oshi-core-4.3.0-SNAPSHOT.jar:$PWD/oshi-demo-4.3.0-SNAPSHOT.jar oshi.demo.Json|grep Memo; echo ""; echo "SIAGR Free"; java -jar ~/sigar/sigar.jar Free; echo ""; echo "Linux free"; free; echo ""; echo "/proc/meminfo"; cat /proc/meminfo |grep -e Mem -e Swap -e Cached -e Slab -e Buffer

JSON for Memory:
{"pageSize":1,"total":10315616256,"available":7095476224,"virtualMemory":{"swapTotal":8589930496,"swapUsed":359661568,"swapPagesOut":61952798,"swapPagesIn":18747977},"physicalMemory":[{"bankLabel":"RAM slot #0/RAM slot #0","capacity":8589934592,"clockSpeed":-1,"manufacturer":"Not Specified","memoryType":"DRAM"},{"bankLabel":"RAM slot #1/RAM slot #1","capacity":2147483648,"clockSpeed":-1,"manufacturer":"Not Specified","memoryType":"DRAM"}]}

SIAGR Free
total used free
Mem: 10073844 9793412 280432
-/+ buffers/cache: 9362056 711788
Swap: 8388604 351488 8037116
RAM: 9840MB

Linux free
total used free shared buff/cache available
Mem: 10073844 2638564 294532 20636 7140748 7033716
Swap: 8388604 351488 8037116

/proc/meminfo
MemTotal: 10073844 kB
MemFree: 294776 kB
MemAvailable: 7034120 kB
Buffers: 0 kB
Cached: 431860 kB
SwapCached: 15648 kB
SwapTotal: 8388604 kB
SwapFree: 8037116 kB
Slab: 6708880 kB

Value for available memory from OSHI library of 7093481472 Byte(6927228 kB) is not exact the same but is close to MemAvailable field value of 7034120 kB in /proc/meminfo. It would appear OSHI library LinuxGlobalMemory.getAvailable() API is definitely returning a value closer to what the system is considered as available memory on Linux 7.

Workaround

None

Acceptance Test

None

Assignee

Unassigned

Reporter

Ester Atzmon

Labels

None

Priority

Medium

SalesForce Case ID

12664

Fix versions

None

Commitment Version/s

None

Due date

None

Product

XAP

Edition

Open Source

Platform

All
Configure