Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Jena 3.3.0
-
Mac OSX 10.12.5
Description
tbloader2 crashes during the sort phase because when checking for free memory because top reports memory measured in gigabytes ("10G") rather than megabytes and the script (getFreeMem in tbloader2common) is hard coded to expect the memory to be expressed in megabytes ("10M").
The bug can be fixed by checking which unit is used:
case "$OSTYPE" in darwin*) # Have to get this from top FREE_MEM=$(top -l 1 | grep PhysMem | awk '{print $6}') MEM_LEN=${#FREE_MEM} MEM_UNIT=${FREE_MEM:MEM_LEN-1:1} if [ $MEM_UNIT == 'M' ]; then FREE_MEM=${FREE_MEM:0:MEM_LEN-1} FREE_MEM=$(($FREE_MEM * 1024 *1024)) fi if [ $MEM_UNIT == 'G' ]; then FREE_MEM=${FREE_MEM:0:MEM_LEN-1} FREE_MEM=$(($FREE_MEM * 1024 *1024 * 1024)) fi ;;