using different way to obtain free memory