fix stats command and test max memory