fix for calculating rlimit memory limits