Set default max memory according to os.