You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "joshua portway (JIRA)" <ji...@apache.org> on 2017/06/02 22:31:04 UTC

[jira] [Created] (JENA-1356) tbloader2 crashes on OSX with "value too great for base" error

joshua portway created JENA-1356:
------------------------------------

             Summary: tbloader2 crashes on OSX with "value too great for base" error
                 Key: JENA-1356
                 URL: https://issues.apache.org/jira/browse/JENA-1356
             Project: Apache Jena
          Issue Type: Bug
          Components: Cmd line tools
    Affects Versions: Jena 3.3.0
         Environment: Mac OSX 10.12.5
            Reporter: joshua portway


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
      ;;
}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)