Using density-functional-theory (DFT) calculations with the HSE06 hybrid functional, we accurately evaluate the critical thickness of LaAlO3 film for the intrinsic doping in LaAlO3/SrTiO3 (LAO/STO) heterstructures. The calculated critical thickness of 6 unit-cell (uc) layers suggests to rule out the intrinsic doping mechanism. We also calculate the density of oxygen vacancies on the LAO surface at varying LAO thicknesses, preparation oxygen pressures and temperatures by using the condition of chemical equilibrium and DFT calculations. We find that once LAO thickness >=3 uc high-density (~ 10^14 cm^-2 ) oxygen vacancies will inevitably exist on the LAO surface of the LAO/STO heterstructures even though the samples are grown under high oxygen pressure. The oxygen vacancies are stabilized by releasing the electrostatic energy in the LAO film.