Shouldn't  RefreshState() return error ? There might be other things we cannot determine, like how much memory is left