memory percentage function