Use bc to calculate memory limit in bytes, as shell arith may overflow on 32 bits