improve memory usage estimation